The RoutedCommand doesn't quite make sense to me in the M-V-VM pattern. Why go through the effort of creating command bindings when you are holding an instance of the Command within your controller (or ViewModel). Just trust me when I say it's convoluted. At the other extreme, you would have to create a new class for each and every Command that your application provides. While there is a benefit to this scenario in some cases, in most instances it's overkill. A happy medium is having a class that implements ICommand and exposes events for CanExecute and Execute. Hence I give you the DelegatingCommand. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Input; namespace YourNamespaceHere
{ /// <summary> /// Delegate for adding logic for determining if a /// <see cref="DelegatingCommand"/> can be executed /// </summary> /// <param name="parameter"> /// The parameter being passed to the command
Read More...