From 97f107acdbf86becf98771a9a9ec52c9af56bafb Mon Sep 17 00:00:00 2001 From: Waheal <2035582067@qq.com> Date: Mon, 21 Oct 2024 00:05:50 +0800 Subject: [PATCH] For hc:Window -Fixed the bug that property ShowMaxButton will cause the window to fail to restore #228 -Fixed the bug that NonClientAreaHeight property does not take effect --- src/Shared/HandyControl_Shared/Controls/Window/Window.cs | 5 +++-- src/Shared/HandyControl_Shared/Themes/Styles/Window.xaml | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Shared/HandyControl_Shared/Controls/Window/Window.cs b/src/Shared/HandyControl_Shared/Controls/Window/Window.cs index af5913e2..bdd81b1b 100644 --- a/src/Shared/HandyControl_Shared/Controls/Window/Window.cs +++ b/src/Shared/HandyControl_Shared/Controls/Window/Window.cs @@ -193,7 +193,7 @@ public Brush NonClientAreaForeground public static readonly DependencyProperty NonClientAreaHeightProperty = DependencyProperty.Register( nameof(NonClientAreaHeight), typeof(double), typeof(Window), - new PropertyMetadata(22.0)); + new PropertyMetadata(30.0)); public double NonClientAreaHeight { @@ -441,7 +441,8 @@ private IntPtr HwndSourceHook(IntPtr hwnd, int msg, IntPtr wparam, IntPtr lparam { if ((int) wparam == InteropValues.SC_MAXIMIZE || (int) wparam == InteropValues.SC_RESTORE) { - handled = true; + if (WindowState != WindowState.Minimized) + handled = true; } } if (!ShowMinButton) diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Window.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Window.xaml index 713445a4..6fab6c20 100644 --- a/src/Shared/HandyControl_Shared/Themes/Styles/Window.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Styles/Window.xaml @@ -53,7 +53,7 @@ - + @@ -177,7 +177,7 @@ - +