Exemplo n.º 1
0
        /// <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);
            }
        }
Exemplo n.º 2
0
        public ChildDosagePage(ChildDosage drug)
        {
            InitializeComponent();
            //Task<List<ChildDosage>> task = App.LocalDatabase.GetChildDosages(drug);

            //dosages = task.Result;
            this.dosage = drug;

            BindingContext = dosage;
            if (dosage.HasMaxDose)
            {
                max.Text = "Maximum Dose: " + dosage.MaxDose + " " + dosage.Unit;
            }
        }
Exemplo n.º 3
0
        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;
        }