Most MVVM frameworks implement basic Command pattern (for example DelegateCommand in PRISM), that uses Execute and CanExecute methods from ViewModel.
Hovewer, I often need to add a tooltip to the command. For example, I want to describe the purpose of a command or explain, why it has been disabled.
Currently my tooltips are independent, but this results in code duplication of style definitions.
Is there a way to integrate tooltips with the MVVM Command pattern?
Should I create my own Command class, or is it considered bad practice?
Why not just extend PRISM’s ‘Delegate Command’ and add a
ToolTipproperty?I believe by default WPF commands don’t have that property because a
ToolTipdoesn’t have to be a string in WPF – it can be an object, a control, a group of controls, etc