private async Task DeleteField(EntryFieldVm field) { AdditionalFields.Remove(field); if (!string.IsNullOrEmpty(field.Name)) { await _mediator.Send(new DeleteFieldCommand { EntryId = Id, FieldName = field.Name }); UpdateDirtyStatus(true); } }
private void SetCurrentEntry(EntryVm entry) { _current = entry; AdditionalFields = new ObservableCollection <EntryFieldVm>( entry.AdditionalFields.Select(f => { var field = new EntryFieldVm(_cryptography); field.Initialize(f.Name, f.Value, f.IsProtected); return(field); })); Attachments = new ObservableCollection <Attachment>(entry.Attachments.Select(f => new Attachment { Name = f.Key, Content = f.Value })); Attachments.CollectionChanged += (sender, args) => { UpdateDirtyStatus(true); }; RaisePropertyChanged(string.Empty); }