private void AddToList(bool removeOld, object old) { if (removeOld) { RemoveAction.Invoke(Target.Value, (TElement)old); } AddAction.Invoke(Target.Value, Value.Value); }
public SkypeContext() { Users = new ObservableCollection <SkypeUser>(); TestCommand = new DelegateCommand(() => { SkypeCommandLauncher.StartCall("echo123"); }); AddCommand = new DelegateCommand(() => { AddAction?.Invoke(); }); RemoveCommand = new DelegateCommand(() => { RemoveAction?.Invoke(); }); }
private void Button_SaveClicked(object sender, EventArgs e) { var model = (CreditCard)BindingContext; if (Common.ModelIsNull <CreditCard>(model)) { DependencyService.Get <IToast>().ShortAlert("不能有空值"); return; } if (!(model.RepaymentDate >= 1 || model.RepaymentDate <= 31)) { DependencyService.Get <IToast>().ShortAlert("还款日输入错误"); return; } if (!(model.StatementDate >= 1 || model.StatementDate <= 31)) { DependencyService.Get <IToast>().ShortAlert("账单日输入错误"); return; } model.CardNumber = model.CardNumber.Trim(); AddAction?.Invoke(BindingContext, e); DependencyService.Get <IToast>().ShortAlert("添加成功"); Navigation.PopAsync(true); }
public void Add(Transaction transaction) { Transactions.Add(transaction); _addAction?.Invoke(); }