From 4b8da0b2832af9f7f6f3f6394121871b297c2d16 Mon Sep 17 00:00:00 2001 From: Atsushi Kataoka Date: Sun, 29 May 2022 02:21:31 +0900 Subject: [PATCH] `ContentDialog.DefaultButton` should accepts only `Button.IsEnabled = true`. (#311) Thank you for contributing! --- ModernWpf.Controls/ContentDialog/ContentDialog.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ModernWpf.Controls/ContentDialog/ContentDialog.cs b/ModernWpf.Controls/ContentDialog/ContentDialog.cs index e099c2d7..78cbdbbc 100644 --- a/ModernWpf.Controls/ContentDialog/ContentDialog.cs +++ b/ModernWpf.Controls/ContentDialog/ContentDialog.cs @@ -848,7 +848,7 @@ private void HandleKeyDown(KeyEventArgs e) button = PrimaryButton ?? SecondaryButton ?? CloseButton; } - if (button != null) + if (button != null && button.IsEnabled) { OnButtonClick(button, null); e.Handled = true;