From 79776ab848ffd32738ce1d065d9533e44ad9b856 Mon Sep 17 00:00:00 2001 From: estrogen elf <87099578+BlossomiShymae@users.noreply.github.com> Date: Fri, 13 Jun 2025 22:57:22 -0500 Subject: [PATCH] refactor: use provided Windows 11 check --- .../Views/MainWindow/MainWindowView.axaml.cs | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/Needlework.Net/Views/MainWindow/MainWindowView.axaml.cs b/Needlework.Net/Views/MainWindow/MainWindowView.axaml.cs index 3f9eef6..49fadfc 100644 --- a/Needlework.Net/Views/MainWindow/MainWindowView.axaml.cs +++ b/Needlework.Net/Views/MainWindow/MainWindowView.axaml.cs @@ -1,5 +1,3 @@ -using System; -using System.Runtime.InteropServices; using Avalonia.Controls; using FluentAvalonia.UI.Windowing; @@ -13,18 +11,6 @@ public partial class MainWindowView : AppWindow 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; + Background = IsWindows11 ? null : Background; } } \ No newline at end of file