/// <summary> /// navigate to Pediatric Dosage Calculator /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void Button_Clicked_1(object sender, EventArgs e) { var drug = (PrimaryDrug)DrugDetails.BindingContext; Task <List <ChildDosage> > task = App.LocalDatabase.GetChildDosages(drug); var drugCount = task.Result.Count(); if (drugCount == 1) { ChildDosage dosage = task.Result.FirstOrDefault(); var page = new ChildDosagePage(dosage); page.Title = "Pediatric Dosage"; if (drug != null) { // DrugCalculatorViewModel.Shared = new DrugCalculatorViewModel(drug); // page.BindingContext = drug; } await Navigation.PushAsync(page); } else { var page = new ChildDoseSubCategoryPage(task.Result); page.BindingContext = task.Result; await Navigation.PushAsync(page); } }
async void Handle_ItemTapped(object sender, ItemTappedEventArgs e) { if (e.Item == null) { return; } ChildDosage dosage = e.Item as ChildDosage; var page = new ChildDosagePage(dosage); page.Title = "Child Dosage"; await Navigation.PushAsync(page); //Deselect Item ((ListView)sender).SelectedItem = null; }