Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Commanding is perfectly supported by Catel. Catel supports Command classes, which is also known as RelayCommand or DelegateCommand in other frameworks. Defining a command on a view model is very easy, as you can see in the code below:

...

  • It requires you to make sure the name of the control is the same as the method;
  • It is not clear that it is actually a command if you are not fully familiar with the conventions;
  • The methods need to be public (otherwise, how are you going to invoke the commands during unit tests?), which make them freely available (and that’s not something we like);
  • You will always have to invoke CanExecute yourself again in Execute, because you have no guarantee that the source of Execute is actually the convention mapping;
  • There is no way to manually refresh the CanExecute state on the bound controls.

For more information, see: