示例#1
0
 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());
 }
示例#2
0
 public async Task Create(MDictionary item) => item.ID = await dictDS.Create(item);
示例#3
0
 public async Task Update(MDictionary item) => await dictDS.Update(item);
示例#4
0
 public void Add(MDictionary item)
 {
     Items.Add(item);
 }