title: show Login window before main window
body: <p>in my wpf application,i want to show login form at sturtup and if user enter a valid username and password, window1 will be displayed.
  i user this code in my app.xmal :</p>
  
  <pre><code>&lt;Application x:Class="Acountant.App"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  Startup="Application_Startup"&gt;
  </code></pre>
  
  <p>and this code in app.xmal.cs :</p>
  
  <pre><code>    private void Application_Startup(object sender, StartupEventArgs e)
      {
        LoginFRM f = new LoginFRM();
  
       if (f.ShowDialog() == true)
       {
         var frm = new Window1();
         frm.ShowDialog();
       }
   }
  </code></pre>
  
  <p>but my Application closed! </p>