Skip to content

Commit a697de1

Browse files
authored
Merge pull request #248 from omid-io/fix/window-resize-after-restore
fix(window): restore WindowChrome resize border thickness when restored from Maximized (closes #246)
2 parents 4a71a33 + ef770dd commit a697de1

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/Shared/HandyControl_Shared/Controls/Window/Window.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Runtime.InteropServices;
33
using System.Windows;
44
using System.Windows.Input;
@@ -261,6 +261,8 @@ protected override void OnStateChanged(EventArgs e)
261261
NonClientAreaHeight = _tempNonClientAreaHeight;
262262
}
263263

264+
ApplyWindowChrome(WindowState);
265+
264266
if (MicaHelper.IsMica)
265267
{
266268
FixCut();

src/Shared/HandyControl_Shared/HandyControls/Controls/Window!.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Windows;
33
using System.Windows.Controls;
44
using System.Windows.Data;
@@ -158,7 +158,7 @@ private void ApplyWindowChrome(WindowState windowsState)
158158
GlassFrameThickness = new Thickness(-1),
159159
ResizeBorderThickness = new Thickness(6)
160160
};
161-
if (windowsState == WindowState.Maximized)
161+
if (windowsState == WindowState.Maximized || ResizeMode == ResizeMode.NoResize)
162162
{
163163
chrome.ResizeBorderThickness = new Thickness(0);
164164
}

0 commit comments

Comments
 (0)