using Avalonia; using Avalonia.Controls; using Avalonia.Markup.Xaml; using Avalonia.Platform; namespace detect.gui.VWS; public partial class NotificationWindow : Window { private static NotificationWindow? _instance; public static NotificationWindow Instance() { return _instance ??= new NotificationWindow(); } public static readonly StyledProperty IsSuccessProperty = AvaloniaProperty.Register(nameof(IsSuccess)); public bool IsSuccess { get => GetValue(IsSuccessProperty); set => SetValue(IsSuccessProperty, value); } public static readonly StyledProperty IsErrorProperty = AvaloniaProperty.Register(nameof(IsError)); public bool IsError { get => GetValue(IsErrorProperty); set => SetValue(IsErrorProperty, value); } public static readonly StyledProperty IsInformationProperty = AvaloniaProperty.Register(nameof(IsInformation)); public bool IsInformation { get => GetValue(IsInformationProperty); set => SetValue(IsInformationProperty, value); } public static readonly StyledProperty IsWarningProperty = AvaloniaProperty.Register(nameof(IsWarning)); public bool IsWarning { get => GetValue(IsWarningProperty); set => SetValue(IsWarningProperty, value); } public static readonly StyledProperty MessageProperty = AvaloniaProperty.Register(nameof(Message)); public string? Message { get => GetValue(MessageProperty); set => SetValue(MessageProperty, value); } public NotificationWindow() { InitializeComponent(); ExtendClientAreaToDecorationsHint = true; ExtendClientAreaChromeHints = ExtendClientAreaChromeHints.NoChrome; ExtendClientAreaTitleBarHeightHint = -1; SystemDecorations = SystemDecorations.None; Topmost = false; ShowInTaskbar = false; CanResize = false; if (Screens.Primary == null) return; var w = Screens.Primary.Bounds.Width / Screens.Primary.Scaling; var h = Screens.Primary.Bounds.Height / Screens.Primary.Scaling; Position = new PixelPoint((int)(w - 260), (int)(h - 93)); } private void InitializeComponent() { AvaloniaXamlLoader.Load(this); } }