I am making some custom ICommand implementation of my own and I see A LOT of implementations going like this:
public event EventHandler CanExecuteChanged
{
a
Very simply - if you are performing heavy work in ICommand.CanExecute()
then you are using Commands
very badly. If you follow that rule there should in fact be no serious performance implication to calling CommandManager.InvalidateRequerySuggested()
.
Pragmatically, it's a much easier implementation than what you've suggested.
Personally, I rather call CommandManager.InvalidateRequerySuggested()
in a particular ViewModel
when a property changes so that the feedback to the user is instantaneous (i.e. enabling a button as soon as a form is completed/valid).