diff --git a/WpfExtended.Blazor/Launch/BlazorHostWindow.xaml b/WpfExtended.Blazor/Launch/BlazorHostWindow.xaml
index a44fc6c..a234b94 100644
--- a/WpfExtended.Blazor/Launch/BlazorHostWindow.xaml
+++ b/WpfExtended.Blazor/Launch/BlazorHostWindow.xaml
@@ -6,19 +6,21 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:WpfExtended.Blazor.Launch"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:shell="clr-namespace:System.Windows.Shell;assembly=PresentationFramework"
x:Name="_this"
Title="BlazorHostWindow"
Width="800"
Height="450"
mc:Ignorable="d">
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/WpfExtended.Blazor/Launch/BlazorHostWindow.xaml.cs b/WpfExtended.Blazor/Launch/BlazorHostWindow.xaml.cs
index be05bb0..676d77a 100644
--- a/WpfExtended.Blazor/Launch/BlazorHostWindow.xaml.cs
+++ b/WpfExtended.Blazor/Launch/BlazorHostWindow.xaml.cs
@@ -33,8 +33,8 @@ public partial class BlazorHostWindow : Window
set
{
this.SetValue(ShowTitleBarProperty, value);
- this.WindowStyle = value ? WindowStyle.SingleBorderWindow : WindowStyle.None;
- this.ResizeMode = value ? ResizeMode.CanResize : ResizeMode.NoResize;
+ this.WindowChrome.CaptionHeight = value ? SystemParameters.CaptionHeight : 0;
+ this.BlazorWebView.Margin = value ? new Thickness(0, SystemParameters.CaptionHeight, 0, 0) : new Thickness(0);
}
}
@@ -64,4 +64,19 @@ public partial class BlazorHostWindow : Window
this.HostPage = blazorLaunchProperties.HostPage;
this.AppType = blazorLaunchProperties.AppType;
}
+
+ protected override void OnStateChanged(EventArgs e)
+ {
+ base.OnStateChanged(e);
+ var cornerRadius = Math.Max(
+ Math.Max(SystemParameters.WindowCornerRadius.TopLeft, SystemParameters.WindowCornerRadius.TopRight),
+ Math.Max(SystemParameters.WindowCornerRadius.BottomLeft, SystemParameters.WindowCornerRadius.BottomRight));
+ this.WindowChrome.ResizeBorderThickness = this.WindowState is WindowState.Maximized ? new Thickness(0) : new Thickness(cornerRadius);
+ this.WindowChrome.CornerRadius = this.WindowState is WindowState.Maximized ? new CornerRadius(0) : SystemParameters.WindowCornerRadius;
+ this.BlazorWebView.Margin = this.WindowState is WindowState.Maximized
+ ? this.ShowTitleBar
+ ? new Thickness(cornerRadius, SystemParameters.CaptionHeight + cornerRadius, cornerRadius, cornerRadius)
+ : new Thickness(cornerRadius)
+ : new Thickness(0, this.ShowTitleBar ? SystemParameters.CaptionHeight : 0, 0, 0);
+ }
}
diff --git a/WpfExtended.Blazor/WpfExtended.Blazor.csproj b/WpfExtended.Blazor/WpfExtended.Blazor.csproj
index e775172..5f7d1b6 100644
--- a/WpfExtended.Blazor/WpfExtended.Blazor.csproj
+++ b/WpfExtended.Blazor/WpfExtended.Blazor.csproj
@@ -4,7 +4,7 @@
net9.0-windows
true
true
- 0.7.15
+ 0.8.0
latest
Extension library for Blazor Hybrid running on Windows Presentation Platform.
diff --git a/WpfExtended/WpfExtended.csproj b/WpfExtended/WpfExtended.csproj
index 402e7cc..f98b530 100644
--- a/WpfExtended/WpfExtended.csproj
+++ b/WpfExtended/WpfExtended.csproj
@@ -4,7 +4,7 @@
net9.0-windows
true
true
- 0.7.15
+ 0.8.0
latest
Extension library for Windows Presentation Platform.