If the user logs on successfully, then I want to show the main window, if not, I want to exit the application

I think I figured out what I was trying to do.

1) I needed to set the “StartupUri” in the App.xaml to “Logon.xaml”, where Logon.xaml is my logon window.

2) in the LogonButton_Click event handler, I added the following

if (blnAuthenticateSuccessful) {
    MainWindow main = new MainWindow();
    App.Current.MainWindow = main;
    this.Close();
    main.Show();
}

This seems to accomplish what I want.

Leave a Comment