private void ShowPasswordWindow() { PasswordViewModel passwordViewModel = new PasswordViewModel(); string enteredPassword = dialogService.OpenPasswordDialog(passwordViewModel); if (password.CheckPassword(enteredPassword)) { IsSingIn = true; } else if (enteredPassword == null) { } else { MessageBox.Show("Неправельный пароль!"); ShowPasswordWindow(); } }
public string OpenPasswordDialog(PasswordViewModel passwordViewModel) { PasswordWindow passwordWindow = new PasswordWindow(passwordViewModel); return(passwordWindow.ShowDialog() == true ? passwordViewModel.EnteredPassword : null); }