Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
105
MenuTool sensitivity not updating properly
posted

Hi, I have a ribbon that contains a MenuTool with a ButtonType of 'Segmented.' This menutool has a command set "delete" but *not* added to the Items collection, and a second command "delete all" that is added.

In the gui this makes it so that there is a delete button, and then if the user wants they can click the little down arrow and select delete all.  The commands themselves work great.  The problem though is that the sensitivity of the delete button does not alawys update right away.

The delete command will become enabled, but will still be grayed out in the ribbon.  If I click anything like the button, the down arrow, or switch to a different tab and then switch back, only then will it become enabled.

I have noticed that when I set the ICommand on the MenuTool, it is not attaching itself to the CanExecuteChanged property of the ICommand (CanExecuteChanged continues to be null).  Is there something I'm missing other than CanExecuteChanged that I need to hook up to make the MenuTool update itself when the command becomes enabled?

This is with version 9.2.20092.2032 which is I know is not the latest version but we can't update to the current SR just yet (hopefully soon).