first commit

This commit is contained in:
2025-07-06 00:23:46 +02:00
commit 38f50c8819
1788 changed files with 112878 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
using System.Runtime.InteropServices;
using Avalonia;
using Avalonia.Controls;
using NitroxModel.Platforms.OS.Windows;
namespace Nitrox.Launcher.Models.Extensions;
public static class VisualExtensions
{
public static void ApplyOsWindowStyling(this Visual visual)
{
if (Avalonia.Controls.Design.IsDesignMode)
{
return;
}
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return;
}
if (visual.GetWindow() is not { } window)
{
return;
}
nint? windowHandle = window.TryGetPlatformHandle()?.Handle;
if (!windowHandle.HasValue)
{
return;
}
WindowsApi.EnableDefaultWindowAnimations(windowHandle.Value, window.CanResize);
}
public static Window GetWindow(this Visual visual) => TopLevel.GetTopLevel(visual) as Window;
}