title: Need help understanding MVVM Tutorial, RelayCommand & Use of lambdas
body: <p>I am reading Josh Smith' <a href="http://msdn.microsoft.com/en-us/magazine/dd419663.aspx" rel="nofollow noreferrer">WPF Apps With The Model-View-ViewModel Design Pattern</a> tutorial  </p>
  
  <p>i don't understand what the below code is trying to do.<br>
  First, the syntax reminds me properties, but with add/remove instead. </p>
  
  <p>But what is <code>CommandManager.RequerySuggested</code>?</p>
  
  <blockquote>
    <p>It delegates the event subscription to
    the CommandManager.RequerySuggested
    event. This ensures that the WPF
    commanding infrastructure asks all
    RelayCommand objects if they can
    execute whenever it asks the built-in
    commands</p>
  </blockquote>
  
  <pre><code>//Figure 3 The RelayCommand Class
  public class RelayCommand : ICommand 
  { 
  #region Fields 
      readonly Action&lt;object&gt; _execute; 
      readonly Predicate&lt;object&gt; _canExecute; 
  #endregion // Fields
  #region Constructors 
  public RelayCommand(Action&lt;object&gt; execute) : this(execute, null) 
  { } 
  public RelayCommand(Action&lt;object&gt; execute, Predicate&lt;object&gt; canExecute) 
  { 
      if (execute == null) throw new ArgumentNullException("execute"); 
     _execute = execute; 
     _canExecute = canExecute; 
  } 
  #endregion // Constructors 
  #region ICommand Members 
  [DebuggerStepThrough] 
  public bool CanExecute(object parameter) 
  { 
      return _canExecute == null ? true : _canExecute(parameter); 
  } 
  public event EventHandler CanExecuteChanged 
  { 
      add    { CommandManager.RequerySuggested += value; } 
      remove { CommandManager.RequerySuggested -= value; } 
  } 
  public void Execute(object parameter) 
  { _execute(parameter); } 
  #endregion // ICommand Members }
  </code></pre>
  
  <p>Also, save command is configured with lambdas. 1st, there are 2 param variables. 
  Will they conflict? i cannot just do something like <code>RelayCommand(this.Save(), this.CanSave)</code> or is there no such syntax. </p>
  
  <pre><code>_saveCommand = new RelayCommand(param =&gt; this.Save(),
                                  param =&gt; this.CanSave );
  </code></pre>