private void ButtonLogin(object sender, RoutedEventArgs e) { ActiveUser = Authentication.AuthCheck(textBoxEmail.Text, textBoxPassword.Password); if (ActiveUser == null) { MessageBox.Show("Such Email & Password combination doesn't exist"); textBoxEmail.Clear(); textBoxPassword.Clear(); textBoxEmail.Focus(); } else { ScheduleWindow Main = new ScheduleWindow(ActiveUser); Main.Show(); Close(); } }