views:

15

answers:

1

Hi,

When will the CanExecute event be ideally raised by the control that realizes the ICommandSource interface?? I tried to add a breakpoint to the handler to check when it is getting raised and it seems to be executed whenever the control is rendered on the screen. Can someone explain when exactly it will be raised and how to raise it at will???

Thanks,

Sudarsan Srinivasan

A: 

Looks like CommandManager.InvalidateRequerySuggested() is the only possible way. Check these links for more details,

http://social.msdn.microsoft.com/forums/en-US/wpf/thread/b66a2fda-4e66-47fd-9b1f-1a1be1ce30bf

http://robburke.net/2008/04/23/wpf-command-pattern-when-does-it-query-canexecute/comment-page-1/

Any other solutions??

Sudarsan Srinivasan

sudarsanyes