views:

214

answers:

1

I have a ContextMenu whose items are all bound to commands and enable\disable correctly after ANY Command is invoked from another source but prior to, they are all disabled. So if I run the app, all the MenuItems are disabled but if I invoke any of the bound commands from another source (buttons, for instance) they become synchronized with the CanExecute code. I have no idea how to debug this. Any thought would be helpful!?!

+1  A: 

Sometimes you need to force WPF to re-evaluate whether commands are enabled or not.

Somewhere in your code, add a call to:

CommandManager.InvalidateRequerySuggested();

See if that helps.

Adel Hazzah
Thanks Adel, appreciate you taking the time. I've tried various locations with no joy.
Brad