Skip to content

Commit

Permalink
Fix #168
Browse files Browse the repository at this point in the history
  • Loading branch information
ghost1372 committed Mar 19, 2023
1 parent a6996cd commit 4d3d376
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
7 changes: 7 additions & 0 deletions src/Shared/HandyControl_Shared/Controls/Window/Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,13 @@ protected void OnLoaded(RoutedEventArgs args)
_tempWindowStyle = WindowStyle;
_tempResizeMode = ResizeMode;

if (ResizeMode == ResizeMode.NoResize || WindowState == WindowState.Maximized)
{
var chrome = WindowChrome.GetWindowChrome(this);
chrome.ResizeBorderThickness = new Thickness(0);
WindowChrome.SetWindowChrome(this, chrome);
}

SwitchIsFullScreen(_isFullScreen);
SwitchShowNonClientArea(_showNonClientArea);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ void SetStyle()
}
}
SetWindowChrome(window, true);
Apply(windowHandle, type);

Apply(windowHandle, type);

return true;
}
Expand Down Expand Up @@ -447,19 +447,10 @@ public static WindowChrome GetWindowChrome(bool isMica)
}
#endif
chrome.CornerRadius = new CornerRadius();

if (isMica)
{
chrome.GlassFrameThickness = new Thickness(-1);

if (_window.WindowState == WindowState.Maximized || _window.ResizeMode == ResizeMode.NoResize)
{
chrome.ResizeBorderThickness = new Thickness(0);
}
else
{
chrome.ResizeBorderThickness = new Thickness(6);
}
chrome.ResizeBorderThickness = new Thickness(6);
}
else
{
Expand Down

0 comments on commit 4d3d376

Please sign in to comment.