title: How do I exit a WPF application programmatically?
body: <p>How is one supposed to exit an application such as when the user clicks on the Exit menu item from the File menu?</p>
  <p>I have tried:</p>
  <pre><code>this.Dispose();
  this.Exit();
  Application.ShutDown();
  Application.Exit();
  Application.Dispose();
  </code></pre>
  <p>Among many others. Nothing works.</p>