title: WPF showing dialog before main window
body: <p>How one can show dialog window (e.g. login / options etc.) before the main window?</p>
  
  <p>Here is what I tried (it apparently <a href="http://www.ageektrapped.com/blog/the-wpf-application-class-overview-and-gotcha/" rel="noreferrer">has once worked</a>, but not anymore):</p>
  
  <p><strong>XAML</strong>:</p>
  
  <pre><code>&lt;Application ...
      Startup="Application_Startup"&gt;
  </code></pre>
  
  <p><strong>Application</strong>:</p>
  
  <pre><code>public partial class App : Application
  {
      private void Application_Startup(object sender, StartupEventArgs e)
      {
          Window1 myMainWindow = new Window1();
          DialogWindow myDialogWindow = new DialogWindow();
          myDialogWindow.ShowDialog();
      }
  }
  </code></pre>
  
  <p><strong>Outcome</strong>: myDialogWindow is shown first. When it is closed, the Window1 is shown as expected. But as I close Window1 the application does not close at all.</p>