title: Why use a RelayCommand or DelegateCommand instead of just implementing ICommand?
body: <p>I'm just learning about MVVM in WPF, I'm completely new both to WPF as to MVVM (I understand how it works, but have never used it...)</p>
  
  <p>Every single tutorial/article I find on the web, it uses either RelayCommand, or the DelegateCommand.</p>
  
  <p>In my opnion, these patterns obligues the VM to violate the SRP principle, since it will hold the command logic inside them.</p>
  
  <p>Why not just use a custom implementation of the ICommand interface? Just like this:</p>
  
  <p>Imagine that you're displaying a person and saving it to the DB:</p>
  
  <p>My Xaml would be this:</p>
  
  <pre><code>&lt;StackPanel&gt;                         
      &lt;TextBlock Width="248" Height="24" Text="The name is:: " /&gt;
      &lt;TextBlock Width="248" Height="24" Text="{Binding Name}"&gt;            
      &lt;/TextBlock&gt;
      &lt;TextBox HorizontalAlignment="Left" Name="textBox1" Width="120" Height="23" 
               VerticalAlignment="Top" Text="{Binding Name}"
               /&gt;
      &lt;Button  Name="Salvar" VerticalAlignment="Bottom" 
              Command="{Binding SavePerson}" 
              CommandParameter="{Binding}"&gt;Save&lt;/Button&gt;
  &lt;/StackPanel&gt;
  </code></pre>
  
  <p>And this is my VM:</p>
  
  <pre><code>public class PersonVM: INotifyPropertyChanged
  {
      private string nameValue;
  
      public string Name
      {
          get{
              return nameValue;
          }
          set
          {
              if (value != this.nameValue)
              {
                  this.nameValue= value;
                  NotifyPropertyChanged("Name");
              }
          }
      }
  
  
      public ICommand SavePerson{ get { return new SavePersonCommand(); } }
      #region INotifyPropertyChanged Members
  
  
      public event PropertyChangedEventHandler PropertyChanged;
  
      private void NotifyPropertyChanged(String info)
      {
          if (PropertyChanged != null)
          {
              PropertyChanged(this, new PropertyChangedEventArgs(info));
          }
      }
  
      #endregion
  }
  </code></pre>
  
  <p>And this is my Command:</p>
  
  <pre><code>public class SavePersonCommand: ICommand
  {       
      #region ICommand Members
  
      public bool CanExecute(object parameter)
      {
          return (parameter as PersonVM) != null;            
      }
  
      public event EventHandler CanExecuteChanged;
  
      public void Execute(object parameter)
      {
              PersonVM person = parameter as PersonVM;
              if(person != null)
                  //Actually Save the person...            
      }   
  
  
      #endregion
  }
  </code></pre>
  
  <p>What's the problem with my approach?</p>