diff --git a/Needlework.Net/Program.cs b/Needlework.Net/Program.cs index 0a1cc67..af77628 100644 --- a/Needlework.Net/Program.cs +++ b/Needlework.Net/Program.cs @@ -36,7 +36,11 @@ class Program return AppBuilder.Configure(() => new App(BuildServices())) .UsePlatformDetect() .WithInterFont() - .LogToTrace(); + .LogToTrace() + .With(new Win32PlatformOptions + { + CompositionMode = [ Win32CompositionMode.WinUIComposition, Win32CompositionMode.DirectComposition ] + }); } private static IServiceProvider BuildServices() diff --git a/Needlework.Net/Views/MainWindow/MainWindowView.axaml.cs b/Needlework.Net/Views/MainWindow/MainWindowView.axaml.cs index ec6a532..3f9eef6 100644 --- a/Needlework.Net/Views/MainWindow/MainWindowView.axaml.cs +++ b/Needlework.Net/Views/MainWindow/MainWindowView.axaml.cs @@ -1,3 +1,6 @@ +using System; +using System.Runtime.InteropServices; +using Avalonia.Controls; using FluentAvalonia.UI.Windowing; namespace Needlework.Net.Views.MainWindow; @@ -9,5 +12,19 @@ public partial class MainWindowView : AppWindow InitializeComponent(); TitleBar.ExtendsContentIntoTitleBar = true; + TransparencyLevelHint = [WindowTransparencyLevel.Mica, WindowTransparencyLevel.None]; + + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + if (IsWindows11OrNewer()) + { + Background = null; + } + } + } + + private static bool IsWindows11OrNewer() + { + return Environment.OSVersion.Version.Major >= 10 && Environment.OSVersion.Version.Build >= 22000; } } \ No newline at end of file diff --git a/Needlework.Net/Views/Pages/Endpoints/EndpointsTabView.axaml b/Needlework.Net/Views/Pages/Endpoints/EndpointsTabView.axaml index 64441ea..2daa3bd 100644 --- a/Needlework.Net/Views/Pages/Endpoints/EndpointsTabView.axaml +++ b/Needlework.Net/Views/Pages/Endpoints/EndpointsTabView.axaml @@ -15,6 +15,27 @@ + + + + + + + + + +