Beispiel #1
0
        private void LbiLogOut_Selected(object sender, RoutedEventArgs e)
        {
            LogInPage login = new LogInPage(mainWindow)
            {
                Owner = mainWindow
            };

            login.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            login.ShowDialog();

            if (login.wasClosed)
            {
                mainWindow.Close();
            }
        }
Beispiel #2
0
        private void App_Startup(object sender, StartupEventArgs e)
        {
            // start the main window
            MainWindow main = new MainWindow();

            main.Show();

            // start the login page
            LogInPage login = new LogInPage(main)
            {
                Owner = main
            };

            login.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            login.ShowDialog();

            // check if the login window was closed
            if (login.wasClosed)
            {
                main.Close();
            }
        }