Added WindowStyle
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0-windows10.0.19041.0</TargetFramework>
|
||||
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
|
||||
<RootNamespace>Toolkit.UI.WinUI</RootNamespace>
|
||||
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) >= 8">
|
||||
win-x86;win-x64;win-arm64
|
||||
</RuntimeIdentifiers>
|
||||
<RuntimeIdentifiers Condition="$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)')) < 8">
|
||||
win10-x86;win10-x64;win10-arm64
|
||||
</RuntimeIdentifiers>
|
||||
<UseWinUI>true</UseWinUI>
|
||||
<WindowsSdkPackageVersion>10.0.19041.41</WindowsSdkPackageVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />
|
||||
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.240923002" />
|
||||
<PackageReference Include="WinUIEx" Version="2.4.2" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,25 @@
|
||||
using Microsoft.UI.Xaml;
|
||||
using WinUIEx;
|
||||
|
||||
namespace Toolkit.UI.WinUI;
|
||||
|
||||
public static partial class WindowExtensions
|
||||
{
|
||||
public static void SetWindowStyle(this Window window,
|
||||
WindowStyle style)
|
||||
{
|
||||
WinUIEx.WindowStyle windowStyle = window.GetWindowStyle();
|
||||
|
||||
switch (style)
|
||||
{
|
||||
case WindowStyle.None:
|
||||
windowStyle &= ~(WinUIEx.WindowStyle.Caption |
|
||||
WinUIEx.WindowStyle.ThickFrame |
|
||||
WinUIEx.WindowStyle.Border |
|
||||
WinUIEx.WindowStyle.SysMenu);
|
||||
break;
|
||||
}
|
||||
|
||||
window.SetWindowStyle(windowStyle);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Toolkit.UI.WinUI;
|
||||
|
||||
public enum WindowStyle
|
||||
{
|
||||
None,
|
||||
SingleBorderWindow,
|
||||
ThreeDBorderWindow,
|
||||
ToolWindow
|
||||
}
|
||||
+14
@@ -15,6 +15,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Toolkit.Windows", "Toolkit.
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Toolkit.WinUI", "Toolkit.WinUI\Toolkit.WinUI.csproj", "{D90BFF29-B38C-432E-849A-28C5A88A6DDD}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Toolkit.UI.WinUI", "Toolkit.UI.WinUI\Toolkit.UI.WinUI.csproj", "{13C89DC0-5B75-4368-930D-D156B06E3F6A}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -97,6 +99,18 @@ Global
|
||||
{D90BFF29-B38C-432E-849A-28C5A88A6DDD}.Release|x64.Build.0 = Release|Any CPU
|
||||
{D90BFF29-B38C-432E-849A-28C5A88A6DDD}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{D90BFF29-B38C-432E-849A-28C5A88A6DDD}.Release|x86.Build.0 = Release|Any CPU
|
||||
{13C89DC0-5B75-4368-930D-D156B06E3F6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{13C89DC0-5B75-4368-930D-D156B06E3F6A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{13C89DC0-5B75-4368-930D-D156B06E3F6A}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{13C89DC0-5B75-4368-930D-D156B06E3F6A}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{13C89DC0-5B75-4368-930D-D156B06E3F6A}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{13C89DC0-5B75-4368-930D-D156B06E3F6A}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{13C89DC0-5B75-4368-930D-D156B06E3F6A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{13C89DC0-5B75-4368-930D-D156B06E3F6A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{13C89DC0-5B75-4368-930D-D156B06E3F6A}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{13C89DC0-5B75-4368-930D-D156B06E3F6A}.Release|x64.Build.0 = Release|Any CPU
|
||||
{13C89DC0-5B75-4368-930D-D156B06E3F6A}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{13C89DC0-5B75-4368-930D-D156B06E3F6A}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
Reference in New Issue
Block a user