Dispenser/DispenserUI/Views/MainWindow.axaml.cs

30 lines
714 B
C#

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);
}
}