
I'm experiencing an issue where a ribbon menu (of buttons) remains grayed out, although the CanExecute functions of the bound commands have been executed and returned true. Once in this situation the only way to get the menu to become enabled is by switching to another tab and then back again. After switching back the buttons are enabled/disabled according to the CanExecute result. The buttons placed directly on the ribbon exhibit the same behavior.
The buttons are linked to global Composite Commands (as per the discussion here). An example button:The only case where this doesn't seem to apply is a ribbon menu where one of the commands has a CanExecute that always returns true. This menu is always enabled and all of the buttons on it respond immediately to the results of CanExecute functions being called.
I think that the ribbon buttons should be updating automatically, but perhaps there is some event I can publish or something else I can do to manually make the update happen? Do you have any advice on how to troubleshoot this?
The buttons are linked to global Composite Commands (as per the discussion here). An example button:
<ribbon:Button Label="Close This Data" ImageSourceSmall="/Oasis.Presentation;component/Images/Ribbon/CloseThisRow16.png" ImageSourceLarge="/Oasis.Presentation;component/Images/Ribbon/CloseThisRow32.png" Command="{x:Static modules:GlobalCommands.CloseThisItemCommand}" />
I think that the ribbon buttons should be updating automatically, but perhaps there is some event I can publish or something else I can do to manually make the update happen? Do you have any advice on how to troubleshoot this?