private void EditDebtClicked(object sender, EventArgs e) { var argument = new DebtManipulationViewModel { Id = Debt?.Id, Name = Debt?.Name, Amount = Debt.Balance }; MessagingCenter.Send(this, "update", argument); }
private async void Delete(DebtCell cell, DebtManipulationViewModel vm) { var result = await UserDialogs.Instance.ConfirmAsync("Seguro que deseas pagar esta deuda"); if (result) { UserDialogs.Instance.ShowLoading(AppStrings.Wait); var updated = new Debt { Id = vm.Id, Reason = "Full payment", Balance = -1 * vm.Amount }; var debtResult = await _serviceClient.AddMovementToDebt(updated); DebtModificationPage_DebtUpdated(this, debtResult); UserDialogs.Instance.HideLoading(); } }
public DebtCell() { InitializeComponent(); var deleteAction = new MenuItem { Text = AppStrings.PayDebt, IsDestructive = true, Icon = "substract" }; deleteAction.Clicked += (s, a) => { var argument = new DebtManipulationViewModel { Id = Debt?.Id, Name = Debt?.Name, Amount = Debt.Balance }; MessagingCenter.Send(this, "deleted", argument); }; ContextActions.Add(deleteAction); }
private async Task OpenDebtModificationPage(DebtManipulationViewModel debtModification = null) { DebtModificationPage.DebtManipulation = debtModification; await PopupNavigation.PushAsync(DebtModificationPage); }