Command canexecute not updating daemon tools stuck on updating virtual devices

Posted by / 08-Sep-2020 23:17

This happens at various times, such as when input focus shifts to another control, an item is selected in a list, etc.

Hi Tony, By "ribbon menu" do you mean that you have a ribbon: Popup Button (or ribbon: Split Button) that remains disabled even though a ribbon: Menu of ribbon: Button objects on its popup are all enabled?

Hi Tony, What you might want to do is set a Command on the Popup Button that is just used to control its enabled state via the command's Can Execute calls.

I've created an Async Command that returns false for Can Execute while the command is running, which is great except I can't seem to update the Can Execute so it never gets disabled.

However, what if you have 10 commands, and they all have the same dependant property? Is it effectively a `Raise All Property Changed()` for commands. Disclaimer I kind of stole the idea for this from here.

I’m not selling this as a massively scalable, all singing, all dancing solution.

command canexecute not updating-16command canexecute not updating-59command canexecute not updating-79

I lifted this little trick straight from Reflector, as I perused the Routed Command class…

One thought on “command canexecute not updating”