/// <summary> /// Commit password entry creation /// </summary> private void CreateEntry() { var copy = PasswordEntry.Copy(); databaseRepository.AddPasswordEntry(copy); iconsService.DownloadIcon(copy.Website); Messenger.Default.Send(new EntryAddedMessage(this, copy)); }
/// <summary> /// Commit the edition /// </summary> private void ValidateEdition() { // Copy to avoid same instance manipulation var copy = PasswordEntry.Copy(); databaseRepository.UpdatePasswordEntry(copy); iconsService.DownloadIcon(copy.Website); Messenger.Default.Send(new EntryEditedMessage(this, copy)); RaisePropertyChanged(nameof(PasswordEntry)); SetElementsVisibility(ViewModes.View); }
/// <summary> /// Set the view mode to edition /// </summary> private void StartEdition() { backupPasswordEntry = PasswordEntry.Copy(); PasswordEntry.PropertyChanged += PasswordPropertyChanged; SetElementsVisibility(ViewModes.Edition); }