/// <summary> /// changing visibility for 2 step verification /// </summary> /// <param name="obj"></param> private void ForgotLinkClick(object obj) { if (_commonObj.IsEmailValid(UserEmail) && string.IsNullOrEmpty(pbData.ActiveUser)) { ForgotMasterPasswordControlVisibility = true; if (Application.Current.MainWindow != null) { Application.Current.MainWindow.Hide(); } mp = new ForgotMasterPassword(); mp.DataContext = this; if (Application.Current.MainWindow != null) { mp.Owner = Application.Current.MainWindow; } ForgotMasterPasswordModel.ShowFirstScreenClick(null); //we always show first screen mp.ShowDialog(); } else if (!string.IsNullOrEmpty(pbData.ActiveUser)) { ErrorMessage = (string)System.Windows.Application.Current.FindResource("DatabaseLocked"); } else { ErrorMessage = (string)System.Windows.Application.Current.FindResource("IncorrectMailFormatMessage"); } }
private void CloseForgotMasterPasswordDialogClick(object obj) { mp.Close(); mp = null; ForgotMasterPasswordControlVisibility = false; var window = _systemTray.CurrentWindow("LoginWindow"); if (window != null) { window.Show(); } }
/// <summary> /// Returns specific Window as return type based on window title consume as parameter /// </summary> /// <param name="windowTitleString"></param> /// <returns></returns> internal Window CurrentWindow(string windowTitleString) { switch (windowTitleString) { case "LoginWindow": LoginWindow window = ((PBApp)Application.Current).FindWindow <LoginWindow>(); return(window); case "ForgotMasterPasswordWindow": ForgotMasterPassword forgotMPW = ((PBApp)Application.Current).FindWindow <ForgotMasterPassword>(); return(forgotMPW); default: return(null); } }