detect/detect.gui/Classes/WindowBase.cs
2024-11-13 17:09:15 +08:00

29 lines
1018 B
C#

using System;
using Avalonia.Controls;
using Avalonia.Platform;
using Avalonia.ReactiveUI;
using detect.gui.ViewModels;
using Avalonia;
namespace detect.gui.Classes;
public class WindowBase<T> : ReactiveWindow<T> where T : ViewModelBase
{
protected WindowBase()
{
Icon = new WindowIcon(AssetLoader.Open(new Uri("avares://detect.gui/Assets/logo.ico")));
Title = "AI智能视频分析平台";
ExtendClientAreaToDecorationsHint = true;
ExtendClientAreaChromeHints = ExtendClientAreaChromeHints.NoChrome;
ExtendClientAreaTitleBarHeightHint = -1;
// WindowStartupLocation = WindowStartupLocation.CenterScreen;
SystemDecorations = SystemDecorations.None;
Topmost = false;
CanResize = false;
if (Screens.Primary == null) return;
Width = Screens.Primary.Bounds.Width / Screens.Primary.Scaling;
Height = Screens.Primary.Bounds.Height / Screens.Primary.Scaling;
Position = new PixelPoint(0, 0);
}
}