Feature request: Conventional disabled action reason

Topics: Actions & Coroutines, Conventions, Feature Requests
Jul 29, 2011 at 8:31 PM
Edited Jul 29, 2011 at 8:34 PM

I love the conventional binding feature of CM where you can set your Button Name like <Button x:Name="Execute" /> and have a method on your ViewModel called Execute and CM automagically glues these together. Furthermore, if you have a property that returns bool with name CanExecute, that property determines the IsEnabled state of the button, so good so far! My feature request is, you may have an additional property returning a string with name CantExecuteReason, the purpose of the property is, when defined, it will hint the user the reason of the button being disabled with a tooltip for example. So, when the button is disabled because of CanExecute returning false at current state, this CantExecuteReason property may return the reason that lays behind.

It makes perfect sense for me in theory but I don't know if this is doable in practice, i.e. placing ToolTips to various elements.


Jul 29, 2011 at 8:39 PM

In Silverlight, Tooltips cannot be made to display on Disabled UI ;( (I think.) There is a way to do it in WPF. I think you have to set some special options. Building this into the framework would be a bit tricky since there is a dependency between the presence of the tooltip and the state of the action guard...and it would only work in WPF.