tags:

views:

22

answers:

0

Is it possible to prevent the WPF CommandManager from executing it's attached CanExecute delegates?

I have an Unhandled Exception Handler routine that displays an error window for the user. I have a situation at the moment where an exception is being thrown as part of a CanExecute chain. This invokes the exception handler, which displays the window. At this point, CommandManager kicks in and requeries the CanExecute, throwing another exception, invoking the handler, showing another window, requerying CanExecute, throwing another exception... etc. etc. etc.

I somehow need to prevent this rerunning of CanExecute. I have tried to simply ignore subsequent errors in the handler, but this means that the exception information in the error window is blank.