public async void ShowLoginDialogWithRememberCheckBox(object obj) { LoginDialogSettings settings = new LoginDialogSettings { ColorScheme = metroWindow.MetroDialogOptions.ColorScheme, RememberCheckBoxVisibility = System.Windows.Visibility.Visible, NegativeButtonVisibility = System.Windows.Visibility.Visible, }; LoginDialogData result = await metroWindow.ShowLoginAsync("Authentication", "Enter your password", settings); if (result == null) { MessageDialogResult messageResult = await metroWindow.ShowMessageAsync("Authentication Information", String.Format("You have canceled")); } else { Users = new ObservableCollection <GetUser_Result>(St.GetUser(result.Username, result.Password).ToList()); try { St.UpdateStarDay(Users[0].ID); } catch { MessageDialogResult messageResult = await metroWindow.ShowMessageAsync("Authentication Information", String.Format("Error occured, please try again..")); } if (Users.Count() != 0 && isLoggedIn == false) { isLoggedIn = true; MessageDialogResult messageResult = await metroWindow.ShowMessageAsync("Authentication Information", String.Format("Log in successfully..")); foreach (Window window in Application.Current.Windows) { if (window.GetType() == typeof(MainWindow)) { (window as MainWindow).cmbChangeUC.SelectedIndex = 1; (window as MainWindow).WindowState = System.Windows.WindowState.Maximized; (window as MainWindow).Account.Visibility = System.Windows.Visibility.Visible; } } } else { MessageDialogResult messageResult = await metroWindow.ShowMessageAsync("Authentication Information", String.Format("Valid Username or Password..")); } } }