title: Logout and return to Login screen in Prism Application
body: <p>I have a login sequence working in my prism based WPF application which shows the login screen before the main window is shown. in my Bootstrapper class, the InitializeShell method looks like this</p>
  
  <pre><code>    protected override void InitializeShell()
      {
          var logon = new LogOnView();
          bool? res = logon.ShowDialog();
          if (!res ?? true)
          {
              Application.Current.Shutdown(1);
          }
          else
          {
              Application.Current.MainWindow.Show();
          }
      }
  </code></pre>
  
  <p>and this works as expected, and is fine if the user logs in, uses the app and then closes it down.</p>
  
  <p>What I now want to do is allow the user to logout, or force a logout pragmatically.</p>
  
  <p>If I use code similar to the above in the MainWindowViewModel to try and kill the MainWindow and show a LogOnView that doesn't work. </p>
  
  <p>It almost feels like I need some sort of Window Manager to show and hide the 2 screens which is initalized once the bootstrapper has done it's thing, or have the bootstrapper respond to an event from the MainWindow or something.</p>
  
  <p>What is the best way to achieve this?   </p>