/// <param name="e"></param> /// <summary> /// Handles the closing of the modal container control. /// </summary> protected virtual void OnClosing(WindowClosingEventArgs e) { if (Closing != null) { Closing.Invoke(this, e); } }
/// <summary> /// Closes the modal dialog. /// </summary> public virtual void Close() { var ex = new WindowClosingEventArgs(); OnClosing(ex); if (!ex.Cancel) { Manager.Input.KeyDown -= Input_KeyDown; Manager.Input.GamePadDown -= Input_GamePadDown; Manager.ModalWindow = lastModal; if (lastModal != null) { lastModal.Focused = true; } Hide(); var ev = new WindowClosedEventArgs(); OnClosed(ev); if (ev.Dispose) { Dispose(); //Close(ModalResult.Cancel); } //Close(ModalResult.Cancel); } //Close(ModalResult.Cancel); }
/// <param name="e"></param> /// <param name="sender"></param> /// </summary> /// Handles the main window's closing event. /// </summary> private void MainWindow_Closing(object sender, WindowClosingEventArgs e) // try { // Let the GUI manager handle it. e.Cancel = true; Manager_WindowClosing(sender, e); }
/// <param name="e"></param> /// <summary> /// Handles the closing of the modal container control. /// </summary> protected virtual void OnClosing(WindowClosingEventArgs e) { if (Closing != null) { Closing.Invoke(this, e); } //Close(ModalResult.Cancel); }
/// <param name="e"></param> /// <param name="sender"></param> /// </summary> /// Handles the Window Closing event. /// </summary> private void Manager_WindowClosing(object sender, WindowClosingEventArgs e) // try { e.Cancel = !exit && exitConfirmation; // Need to create the exit confirmation dialog? if (!exit && exitConfirmation && exitDialog == null) // try { exitDialog = new ExitDialog(Manager); exitDialog.Init(); exitDialog.Closed += closeDialog_Closed; exitDialog.ShowModal(); Manager.Add(exitDialog); } // Nope, just exit. else if (!exitConfirmation) // try { Exit(); } }