private void DisplayLoginScreen()
 {
     LoginWindow loginWindow = new LoginWindow {Owner = this};
     loginWindow.btnCancel.Click += new RoutedEventHandler(btnLoginCancel_Click);
     loginWindow.ShowDialog();
     if (loginWindow.DialogResult.HasValue && loginWindow.DialogResult.Value == false)
     {
         DisplayLoginScreen();
     }
     else
     {
         _patientWindow = new PatientWindow(loginWindow.AuthenticatedUserName);
         _patientWindow.btnBackToLogin.Click += new RoutedEventHandler(btnBackToLogin_Click);
         _patientWindow.btnGoToSessions.Click += new RoutedEventHandler(btnGoToSessions_Click);
         loginWindow.Close();
         _patientWindow.Show();
     }
 }
Ejemplo n.º 2
0
        private void DisplayLoginScreen()
        {
            LoginWindow loginWindow = new LoginWindow {
                Owner = this
            };

            loginWindow.btnCancel.Click += new RoutedEventHandler(btnLoginCancel_Click);
            loginWindow.ShowDialog();
            if (loginWindow.DialogResult.HasValue && loginWindow.DialogResult.Value == false)
            {
                DisplayLoginScreen();
            }
            else
            {
                _patientWindow = new PatientWindow(loginWindow.AuthenticatedUserName);
                _patientWindow.btnBackToLogin.Click  += new RoutedEventHandler(btnBackToLogin_Click);
                _patientWindow.btnGoToSessions.Click += new RoutedEventHandler(btnGoToSessions_Click);
                loginWindow.Close();
                _patientWindow.Show();
            }
        }