private void BtnPatient_Click(object sender, RoutedEventArgs e) { ViewModelPatientList vm = new ViewModelPatientList(); PagePatientList ppl = new PagePatientList(vm); ContentFrame.Navigate(ppl); }
private void BtnSave_Click(object sender, RoutedEventArgs e) { Patient patient = new Patient(); patient.FirstName = TBFirstName.Text; patient.LastName = TBLastName.Text; patient.PatientNumber = TBPatientNumber.Text; patient.PostPatient(patient); ViewModelPatientList vm = new ViewModelPatientList(); PagePatientList ppl = new PagePatientList(vm); NavigationService.Navigate(ppl); }
private void BtnCancel_Click(object sender, RoutedEventArgs e) { ViewModelPatientList vm = new ViewModelPatientList(); PagePatientList ppl = new PagePatientList(vm); Frame pageFrame = null; DependencyObject currParent = VisualTreeHelper.GetParent(this); while (currParent != null && pageFrame == null) { pageFrame = currParent as Frame; currParent = VisualTreeHelper.GetParent(currParent); } pageFrame.Navigate(ppl); }
private void TBArchive_Checked(object sender, RoutedEventArgs e) { DependencyObject dep = (DependencyObject)e.OriginalSource; while ((dep != null) && !(dep is ListViewItem)) { dep = VisualTreeHelper.GetParent(dep); } if (dep == null) { return; } Patient patient = (Patient)LVPatients.ItemContainerGenerator.ItemFromContainer(dep); patient.SetArchived(patient); ViewModelPatientList vm = new ViewModelPatientList(); PagePatientList ppl = new PagePatientList(vm); NavigationService.Navigate(ppl); }