Dispenser/DispenserUI/Views/MainWindow.axaml.cs

30 lines
714 B
C#
Raw Normal View History

2024-08-16 07:20:09 +00:00
using Avalonia.Controls;
using Avalonia.Controls.Notifications;
using Avalonia.Controls.Primitives;
using Avalonia.Markup.Xaml;
using DispenserCommon.Utils;
namespace DispenserUI.Views;
public partial class MainWindow : Window
{
private WindowNotificationManager? _manager;
public MainWindow()
{
InitializeComponent();
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{
base.OnApplyTemplate(e);
WindowUtil.SetMainWindow(this);
_manager = new WindowNotificationManager(this) { MaxItems = 5 };
ToastUtil.SetManager(_manager);
}
}