SolidShineUi.Wpf.Windows11Interop
2.0.3
dotnet add package SolidShineUi.Wpf.Windows11Interop --version 2.0.3
NuGet\Install-Package SolidShineUi.Wpf.Windows11Interop -Version 2.0.3
<PackageReference Include="SolidShineUi.Wpf.Windows11Interop" Version="2.0.3" />
<PackageVersion Include="SolidShineUi.Wpf.Windows11Interop" Version="2.0.3" />
<PackageReference Include="SolidShineUi.Wpf.Windows11Interop" />
paket add SolidShineUi.Wpf.Windows11Interop --version 2.0.3
#r "nuget: SolidShineUi.Wpf.Windows11Interop, 2.0.3"
#:package SolidShineUi.Wpf.Windows11Interop@2.0.3
#addin nuget:?package=SolidShineUi.Wpf.Windows11Interop&version=2.0.3
#tool nuget:?package=SolidShineUi.Wpf.Windows11Interop&version=2.0.3
Solid Shine UI WPF Windows 11 Interop
This adds support for Windows 11's title bar customization to use with SolidShineUI's FlatWindow, via way of the Windows App SDK. This will allow you to use Windows 11's caption buttons in place of SolidShineUi's custom ones. (This also enables support for the Snap Layouts popup to appear when hovering over the Maximize button.)
Utilizing with FlatWindow
- Make sure your app's csproj file is targetting .NET 8 or later, and Windows 10 19041 or later
(e.g.,
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>) - Add an event handler for FlatWindow's SourceInitialized event.
- In that event handler, add in the line
this.UseWindows11CaptionButtons();
I will also recommend you disable MRT Core in your WPF app if you're not using it. Also keep in mind how utilizing the Windows App SDK will affect how you package and distribute your app.
The end result should look like this:
In your app's csproj file:
MyProject.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<EnableCoreMrtTooling>false</EnableCoreMrtTooling>
<RuntimeIdentifiers>win-x64;win-x86;win-arm64</RuntimeIdentifiers>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SolidShineUi" Version="2.0.0" />
<PackageReference Include="SolidShineUi.Wpf.Windows11Interop" Version="2.0.0" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.8.260804001" />
</ItemGroup>
In your window's code-behind:
MyWindow.xaml.cs
public MyWindow()
{
// other window setup/initialization code
SourceInitialized += MyWindow_SourceInitialized;
}
private void MyWindow_SourceInitialized(object sender, EventArgs e)
{
this.UseWindows11CaptionButtons();
}
Repeat the code-behind part for each window that you want to make this change for. This change is only opt-in for each individual window, not applied project wide.
Known Issues
Maximized window
By default, FlatWindow will add an extra gray frame around its edges when the window is maximized. This is to counteract some Windows design decision that cuts off the edges of a window when it is maximized. Usually, this gray frame is hidden as that is what gets cut off, and all is fine. However, when using this package to utilize Windows 11's title bar customization, this also somehow prevents the cutting off from occurring... meaning that the gray frame then becomes visible.
To solve this issue, a new property is being added in SolidShineUi 2.0.3 and 1.9.11 that will
allow the gray frame to be hidden, called MaximizedWindowFrame. If you use versions 1.9.11 or
2.0.3 of this package, that fix will be automatically applied.
For earlier versions of SolidShineUi, you will need to create a custom style for FlatWindow or find a different way to go about hiding the frame or restoring the cutting-off behavior.
Resize handles / hit zones
I'm not sure why, but the hit/hover areas for the mouse to be in for resizing the window end up being outside the actual window itself. I don't know what the cause of this issue is, so I'm not quite sure yet how to solve it.
For now, you could add on extra resize grippers at the corners of the window to provide other areas where your users can resize the window.
Which version to use
Different versions of this package (SolidShineUi.Wpf.Windows11Interop) are intended to be used with different versions of SolidShineUi. See the below table to see which one you should use, based on which version of SolidShineUi you are using.
| SSUI Version | Use This Version |
|---|---|
| 1.9.5 - 1.9.10 | 1.9.5.x |
| 1.9.11 - 1.9.12 | 1.9.11.x |
| 2.0.0 - 2.0.2 | 2.0.0.x |
| 2.0.3 + | 2.0.3.x |
(If there are newer versions of this package than what's listed above, use the one that corresponds to the version of SolidShineUi you're using (e.g., use version 3.0 if you're using SSUI 3.0).)
Versions of Solid Shine UI prior to 1.9.5 aren't supported by this, because they are missing
the ability to set the FlatWindow's CaptionDisplayType to None.
Avalonia support
Further investigation is being done as to what is needed for the Avalonia version of SSUI. It may be that this library is not needed for the Avalonia version at all.
License / About
This code is created by Jayke R. Huempfner (JaykeBird), the maintainer of Solid Shine UI. You can learn more about Solid Shine UI at my website, jaykebird.com, or view the code on GitHub.
This code is released under the MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0-windows10.0.19041 is compatible. net9.0-windows was computed. net9.0-windows10.0.19041 is compatible. net10.0-windows was computed. net10.0-windows10.0.19041 is compatible. |
-
net10.0-windows10.0.19041
- Microsoft.WindowsAppSDK.Foundation (>= 1.8.260803002)
- Microsoft.WindowsAppSDK.InteractiveExperiences (>= 1.8.260708001)
- Microsoft.WindowsAppSDK.Runtime (>= 1.8.260804001)
- SolidShineUi (>= 2.0.3 && < 3.0.0)
-
net8.0-windows10.0.19041
- Microsoft.WindowsAppSDK.Foundation (>= 1.8.260803002)
- Microsoft.WindowsAppSDK.InteractiveExperiences (>= 1.8.260708001)
- Microsoft.WindowsAppSDK.Runtime (>= 1.8.260804001)
- SolidShineUi (>= 2.0.3 && < 3.0.0)
-
net9.0-windows10.0.19041
- Microsoft.WindowsAppSDK.Foundation (>= 1.8.260803002)
- Microsoft.WindowsAppSDK.InteractiveExperiences (>= 1.8.260708001)
- Microsoft.WindowsAppSDK.Runtime (>= 1.8.260804001)
- SolidShineUi (>= 2.0.3 && < 3.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.