public override bool OnKeyDown(KeyboardKeyEventArgs e) { switch (e.Key) { case Key.Enter: OkButton.OnClick(); return(true); case Key.Escape: CancelButton.OnClick(); return(true); } return(false); }