title: How to close a ChildWindow with Cancel button using MVVM Light Toolkit
body: <p>I'm new to MVVM and trying to figure out how to <strong>close a ChildWindow</strong> with the traditional <em>Cancel</em> button using <strong>MVVM Light Toolkit</strong>.</p>
  
  <p>In my ChildWindow (StoreDetail.xaml), I have :</p>
  
  <pre><code>&lt;Button x:Name="CancelButton" Content="Cancel" Command="{Binding CancelCommand}" /&gt;
  </code></pre>
  
  <p>In my ViewModel (ViewModelStoreDetail.cs), I have :</p>
  
  <pre><code>public ICommand CancelCommand { get; private set; }
  
  public ViewModelStoreDetail()
  {
      CancelCommand = new RelayCommand(CancelEval);
  }
  
  private void CancelEval()
  {
      //Not sure if Messenger is the way to go here...
      //Messenger.Default.Send&lt;string&gt;("ClosePostEventChildWindow", "ClosePostEventChildWindow");
  }
  </code></pre>