/// <summary> /// Initializes a new instance of the StartupViewModel class. /// </summary> public StartupViewModel() { if (MainWindow == null) { MainWindow = new MainWindow(); MainWindow.Hide(); } if (UserPreferencesWindow == null) { UserPreferencesWindow = new UserPreferencesWindow(); UserPreferencesWindow.Hide(); } if (RegisterWindow == null) { RegisterWindow = new RegisterWindow(); RegisterWindow.Hide(); } if (AboutWindow == null) { AboutWindow = new AboutWindow(); AboutWindow.Hide(); } App.Current.MainWindow = MainWindow; }
public void InitializeRegister() { registration = new RegisterWindow(); registration.FormClosing += (sender, e) => { if (MessageBox.Show("Are you sure you want to exit?", "Hospital", MessageBoxButtons.YesNo) == DialogResult.No) { e.Cancel = true; } }; registration.registrationCompleted += (sender, e) => { login.Show(); registration.clearFields(); login.clearFields(); registration.Hide(); }; registration.goBackClicked += (sender, e) => { login.Show(); registration.Hide(); }; registration.FormClosed += (sender, e) => { this.Close(); }; }