/// <summary> /// Window Button Click Method /// Handles Button Presses /// </summary> /// <param name="sender">Object Which Called This Function</param> /// <param name="e">The Arguments</param> protected override void Element_Click(object sender, RoutedEventArgs e) { if (e.Source == BaseCreationWindow.buttonOk) { Exit = Enum.ExitStatus.Ok; } BaseCreationWindow.Close(); }
/// <summary> /// Window Key Down Event Method /// Handles Enter And Escape Key Presses /// </summary> /// <param name="sender">Object Which Called This Function</param> /// <param name="e">The Arguments</param> protected override void Window_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Escape) { BaseCreationWindow.Exit = ExitStatus.Cancel; BaseCreationWindow.Close(); } else if (e.Key == Key.Enter) { SaveBaseDetails(); BaseCreationWindow.Exit = ExitStatus.Ok; BaseCreationWindow.Close(); } }