private void btnSleep_Click(object sender, RoutedEventArgs e) { frm = p.Child as Frame; Page page; page = new SleepUpdate(this); frm.Width = page.Width; frm.Height = page.Width; frm.Navigate(page); //Disables histogram page frmSwater.IsEnabled = false; //opens popup p.IsOpen = true; }
private void btnTracker_Click(object sender, RoutedEventArgs e) { //pull button and grid from form Button button = sender as Button; Frame frm = popTrackerPop.Child as Frame; Page page; //switch case to determine which popup opens switch (button.Tag.ToString()) { case "empty": page = new AddTrackerPage(this); frm.Width = page.Width; frm.Height = page.Width; frm.Navigate(page); break; case "Water": page = new WaterUpdate(this); frm.Width = page.Width; frm.Height = page.Width; frm.Navigate(page); break; case "Sleep": page = new SleepUpdate(this); frm.Width = page.Width; frm.Height = page.Width; frm.Navigate(page); break; default: return; } //stops user from interacting with the rest of the app while the dialog is visible frmMain.IsEnabled = false; //opens popup popTrackerPop.IsOpen = true; }