开发者

In WPF/Prism, what happens with a CompositeCommand when a DelegateCommand.RaiseCanExecuteChanged is fired?

Say that I have a CompositeCommand with a lot of DelegateCommands registered.

If one of the child DelegateCommands fires up RaiseCanExecuteChanged, this will result in firing the event CompositeC开发者_JS百科ommand.CanExecuteChanged, raising this same event in the other children, or it will only affect the active DelegateCommand?


Just figured this out. By analyzing the internals of Prism, I noticed that the CompositeCommand registers itself in its children's CanExecuteChanged event. Thus, everytime a registered command raises the CanExecuteChanged handler, the composite command does the same in itself and in all of its children.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜