private void ViewCharge(ChargeViewModel chargeViewModel) { if (ViewChargeRequested != null) { ViewChargeRequested(chargeViewModel, EventArgs.Empty); } }
private void AddChargeToReport(ChargeViewModel chargeViewModel) { this._addChargesViewModel.Charges.Remove(chargeViewModel); chargeViewModel.ExpenseReportId = this.ExpenseReport.ExpenseReportId; this._expenseReportChargesView.Charges.Add(chargeViewModel); }
public void ShowCharge(ChargeViewModel chargeViewModel) { EventHandler<EventArgs<ChargeViewModel>> handler = this.ShowChargeRequested; if (handler != null) { handler(this, new EventArgs<ChargeViewModel>(chargeViewModel)); } }
void CreateNewCharge() { ChargeViewModel viewModel = new ChargeViewModel() { EmployeeId = EmployeeViewModel.EmployeeId }; if (CreateNewChargeRequested != null) { CreateNewChargeRequested(viewModel, EventArgs.Empty); } }
public async Task TestMethod1() { ServiceLocator.Current.SetService<INavigationService>( new StubINavigationService()); StubIViewService viewService = new StubIViewService() { ExecuteBusyActionAsyncFuncOfTask = async (Func<Task> func) => { await func(); } }; ServiceLocator.Current.SetService<IViewService>(viewService); StubIExpenseRepository repository = new StubIExpenseRepository() { GetChargeAsyncInt32 = (chargeId) => { return Task.FromResult( new Charge() { ChargeId = chargeId, }); } }; ServiceLocator.Current.SetService<IExpenseRepository>(repository); // Create a new ChargeViewModel. ChargeViewModel chargeViewModel = new ChargeViewModel(); // Make sure it defaults to a ChargeId of 0. Assert.AreEqual(0, chargeViewModel.ChargeId); // Load the charge with the ChargeId of 1. await chargeViewModel.LoadAsync(1); // Confirm the ViewModel’s ChargeId is 1. Assert.AreEqual(1, chargeViewModel.ChargeId); }
public void ShowCharge(ChargeViewModel charge) { this.CurrentViewModel = charge; }
private void RemoveChargeFromReport(ChargeViewModel chargeViewModel) { chargeViewModel.ExpenseReportId = null; this._expenseReportChargesView.Charges.Remove(chargeViewModel); this._addChargesViewModel.Charges.Add(chargeViewModel); }
private void ViewCharge(ChargeViewModel chargeViewModel) { this.NavigationService.ShowCharge(chargeViewModel); }
private void RemoveChargeFromReport(ChargeViewModel chargeViewModel) { chargeViewModel.ExpenseReportId = null; this._expenseReportChargesView.Charges.Remove(chargeViewModel); this._addChargesViewModel.Charges.Add(chargeViewModel); }
private void AddChargeToReport(ChargeViewModel chargeViewModel) { this._addChargesViewModel.Charges.Remove(chargeViewModel); chargeViewModel.ExpenseReportId = this.ExpenseReport.ExpenseReportId; this._expenseReportChargesView.Charges.Add(chargeViewModel); }
private void ViewCharge(ChargeViewModel chargeViewModel) { this.NavigationService.ShowCharge(chargeViewModel); }