public static MedicalRecordWindow GetInstance(Patient patientToShowMedicalRecord) { if (instance == null) { instance = new MedicalRecordWindow(patientToShowMedicalRecord); } return(instance); }
private void CheckKeyPress() { if ((Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl)) && Keyboard.IsKeyDown(Key.Z)) { MedicalRecordWindow.GetInstance(patient).ShowDialog(); } else if ((Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl)) && Keyboard.IsKeyDown(Key.T)) { SendToHospitalTreatmentWindow.GetInstance(patient).Show(); } else if (Keyboard.IsKeyDown(Key.Escape)) { this.Close(); } }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) => instance = null;