I\'m stuck, why isn\'t this working:
var childAction = new Action(blabla);
Action upperAction = (Action
Your forgetting how these delegates are being used
var childAction = new Action(blabla);
Action upperAction = (Action) childAction;
means that upperAction
will at some point in the future be called, passing some form of an IDomainCommand
object. You are giving it an function which can only handle CancelCommand
objects. But there are (probably) other classes which implement IDomainCommand
, and upperAction
could potenially be called with any of them.