/* * Used when viewing -> editing an existing procedure * Constructor which initialises the entries of the procedures listview. */ public SingleProcedurePage(Procedure procedure, ProceduresPage proceduresPageController) { InitializeComponent(); currentProcedure = procedure; this.proceduresPageController = proceduresPageController; Title = "View Procedure"; affectedOrganStack.IsVisible = false; organsAffected = new CustomObservableCollection <string>(); organsAffectedList.ItemsSource = organsAffected; SummaryEntry.Text = procedure.summary; DescriptionEntry.Text = procedure.description; DateDueEntry.Date = procedure.date.ToDateTime(); organsAffected.AddRange(procedure.organsAffected.ConvertAll(OrganExtensions.ToString)); if (this.proceduresPageController.isClinicianAccessing) { EditProcedureButton.IsVisible = true; } }
/* * Used when adding a new procedure * Constructor which initialises the entries of the procedures listview. */ public SingleProcedurePage(ProceduresPage proceduresPageController) { InitializeComponent(); this.proceduresPageController = proceduresPageController; Title = "Add New Procedure"; organsAvailable = new CustomObservableCollection <string> { "Liver", "Kidney", "Pancreas", "Heart", "Lung", "Intestine", "Cornea", "Middle Ear", "Skin", "Bone Marrow", "Connective Tissue" }; organsAffected = new CustomObservableCollection <string>(); organsAffectedList.ItemsSource = organsAffected; NewAffectedOrganPicker.ItemsSource = organsAvailable; NewAffectedOrganPicker.SelectedIndex = 0; SummaryEntry.IsEnabled = true; DescriptionEntry.IsEnabled = true; DateDueEntry.IsEnabled = true; SummaryEntry.Placeholder = "Summary"; DescriptionEntry.Placeholder = "Description"; DateDueEntry.Date = DateTime.Today; AddProcedureButton.IsVisible = true; }