mirror of
https://github.com/BlossomiShymae/Needlework.Net.git
synced 2025-12-06 10:10:48 +01:00
30 lines
785 B
C#
30 lines
785 B
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
using Avalonia.Controls;
|
|
using FluentAvalonia.UI.Windowing;
|
|
|
|
namespace Needlework.Net.Views.MainWindow;
|
|
|
|
public partial class MainWindowView : AppWindow
|
|
{
|
|
public MainWindowView()
|
|
{
|
|
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;
|
|
}
|
|
} |