title: How to implement Close button in MVVMCross WPF application?
body: <p>I am using <em>MVVMCross</em> in my <em>WPF</em> application, and I want to provide a <em>Close</em> (or <em>Exit</em>) button in the GUI to shut-down the entire application. Is there a straightforward way to do this using <em>MVVMCross</em> functionality?</p>
  
  <p>I have tried the following approach with my <code>MainViewModel</code>:</p>
  
  <pre><code>public class MainViewModel : MvxViewModel
  {
      private MvxCommand _closeCommand;
      public MvxCommand CloseCommand {
          get { 
              return _closeCommand ?? (_closeCommand = new MvxCommand(DoClose));
          }
      }
  
      public void DoClose() {
          Close(this);
      }
  }
  </code></pre>
  
  <p>Unfortunately, to no avail. The <code>DoClose</code> method does get called when I press a button that has been bound to <code>CloseCommand</code>, but the view-model (and corresponding view) fail to close, even when the WPF <code>App</code> <code>StartupUri</code> is set to the <code>MainView</code>.</p>