ModernWPF.Controls.DialogControl.OnKeyDown C# (CSharp) Method

OnKeyDown() protected method

Invoked when an unhandled E:System.Windows.Input.Keyboard.KeyDown attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
protected OnKeyDown ( System e ) : void
e System The that contains the event data.
return void
        protected override void OnKeyDown(System.Windows.Input.KeyEventArgs e)
        {
            if (e != null && CloseOnEscapeKey && e.Key == System.Windows.Input.Key.Escape)
            {
                e.Handled = true;
                DialogResult = false;
            }

            base.OnKeyDown(e);
        }