title: MVVM Foundation: How to close Application Window from ViewModel
body: <p>I am using <a href="http://mvvmfoundation.codeplex.com/" rel="nofollow">MVVM Foundation</a> but I think its quite straight-forward and not really framework specific. My setup is as follows:</p>
  
  <ul>
  <li><p>StartViewModel - has a ExitCommand that returns a RelayCommand/ICommand</p>
  
  <pre><code>public ICommand ExitCommand {
      get { return _exitCommand ?? (_exitCommand = new RelayCommand(() =&gt; MessageBox.Show("Hello World"))); }
  }
  public RelayCommand _exitCommand;
  </code></pre></li>
  <li><p>StartView (User Control) has a button binded to the ExitCommand</p>
  
  <pre><code>&lt;Button Content="Exit" Command="{Binding ExitCommand}" /&gt;  
  </code></pre></li>
  </ul>