protected async void OnItemEdit(object sender, EventArgs e) { var btn = sender as MenuItem; var regItem = btn.BindingContext as AccountRegisterItemViewModel; vm.SelectedRegisterItem = regItem; switch (regItem.ItemType) { case AccountRegisterItemViewModel.AccountItemType.Deposits: SavingsDepositEdit depEditor = new SavingsDepositEdit(); SavingsDepositViewModel _vmDep = regItem as SavingsDepositViewModel; await _vmDep.LoadBudgetData(); depEditor.BindingContext = _vmDep; await Navigation.PushAsync(depEditor); break; case AccountRegisterItemViewModel.AccountItemType.Withdrawals: SavingsWithdrawalEdit witEditor = new SavingsWithdrawalEdit(); SavingsWithdrawalViewModel _vmWithdrawal = regItem as SavingsWithdrawalViewModel; await _vmWithdrawal.LoadBudgetData(); witEditor.BindingContext = _vmWithdrawal; await Navigation.PushAsync(witEditor); break; } }
protected override void OnAppearing() { base.OnAppearing(); vm = this.BindingContext as SavingsWithdrawalViewModel; }
protected override void OnDisappearing() { base.OnDisappearing(); vm = null; }
protected override void OnAppearing() { base.OnAppearing(); vm = this.BindingContext as SavingsWithdrawalViewModel; //await vm.LoadBudgetData(); }