private void NewPasswordButton_Click(object sender, RoutedEventArgs e) { var passwordDto = new Core.Dtos.PasswordDto(); var passwordWindow = new EditPasswordWindow(passwordDto); if (passwordWindow.ShowDialog() == true) { _passwordRepository.Add(new Password(_profile.Id, passwordDto, _password)); RefreshPasswords(); } }
private void listViewItem_MouseDoubleClick(object sender, MouseButtonEventArgs e) { var item = sender as ListViewItem; var id = (Guid)(item.Content as dynamic).Id; var password = _passwordRepository.GetById(id); var passwordDto = password.GetPasswordDto(_password); var passwordWindow = new EditPasswordWindow(passwordDto); if (passwordWindow.ShowDialog() == true) { password.UpdatePasswordDto(passwordDto, _password); _passwordRepository.Update(password); RefreshPasswords(); } }