public DictsDetailViewModel(MDictionary item, DictsViewModel vm) { this.vm = vm; item.CopyProperties(ItemEdit); LANGNAME = vm.vmSettings.SelectedLang.LANGNAME; ItemEdit.Save = ReactiveCommand.CreateFromTask(async() => { ItemEdit.CopyProperties(item); if (item.ID == 0) { await vm.Create(item); } else { await vm.Update(item); } }, ItemEdit.IsValid()); }
public async Task Create(MDictionary item) => item.ID = await dictDS.Create(item);
public async Task Update(MDictionary item) => await dictDS.Update(item);
public void Add(MDictionary item) { Items.Add(item); }