protected async void Add_Clicked(object sender, EventArgs e) { var editViewModel = new MaintenanceRequestEditViewModel(null, _viewModel.Lookups); editViewModel.ItemSaved += (object sender2, EventArgs e2) => { _viewModel.MaintenanceRequestSaved(sender2 as MaintenanceRequest, null); }; var page = new MaintenanceRequestEditPage(); page.BindingContext = editViewModel; await((MainPage)App.Current.MainPage).NavigateTo(page, true); }
private async System.Threading.Tasks.Task editMaintenanceItem(DisplayItem item) { var editViewModel = new MaintenanceRequestEditViewModel(item.Tag as MaintenanceRequest, _viewModel.Lookups); editViewModel.ItemSaved += (object sender, EventArgs e) => { _viewModel.MaintenanceRequestSaved(item.Tag as MaintenanceRequest, item); }; var page = new MaintenanceRequestEditPage(); page.BindingContext = editViewModel; await((MainPage)App.Current.MainPage).NavigateTo(page, true); }