private void OnKeydown(object sender, KeyEventArgs e) { if (isShowing && e.Key == Key.Esc) { CancelButton.InvokeClick(false); } }