/* * Used when viewing -> editing an existing disease * Constructor which initialises the entries of the diseases listview. */ public SingleDiseasePage(DiseasesPage diseasesPageController, Disease disease) { InitializeComponent(); this.diseasesPageController = diseasesPageController; this.currentDisease = disease; Title = "View Disease"; NameEntry.Text = disease.name; DiagnosisDateEntry.Date = disease.diagnosisDate.ToDateTime(); if (disease.isChronic) { ChronicEntry.IsToggled = true; } else { ChronicEntry.IsToggled = false; } if (disease.isCured) { CuredEntry.IsToggled = true; } else { CuredEntry.IsToggled = false; } if (diseasesPageController.isClinicianAccessing) { EditDiseaseButton.IsVisible = true; } }
/* * Used when adding a new disease * Constructor which initialises the entries of the diseases listview. */ public SingleDiseasePage(DiseasesPage diseasesPageController) { InitializeComponent(); this.diseasesPageController = diseasesPageController; Title = "Add Disease"; DiagnosisDateEntry.MaximumDate = DateTime.Today; ChronicEntry.IsToggled = false; CuredEntry.IsToggled = false; NameEntry.IsEnabled = true; DiagnosisDateEntry.IsEnabled = true; ChronicEntry.IsEnabled = true; CuredEntry.IsEnabled = true; AddDiseaseButton.IsVisible = true; }