mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-03-03 00:00:55 +08:00
23 lines
578 B
C#
23 lines
578 B
C#
using Avalonia.Controls;
|
|
using Avalonia.Controls.Notifications;
|
|
|
|
namespace Semi.Avalonia.Demo.Views;
|
|
|
|
public partial class MainWindow : Window
|
|
{
|
|
private readonly WindowNotificationManager _manager;
|
|
public MainWindow()
|
|
{
|
|
InitializeComponent();
|
|
_manager = new WindowNotificationManager(this)
|
|
{
|
|
Position = NotificationPosition.TopLeft,
|
|
MaxItems = 3
|
|
};
|
|
}
|
|
|
|
internal void Notify(NotificationType t)
|
|
{
|
|
_manager.Show(new Notification(t.ToString(), "This is a notification message", t));
|
|
}
|
|
} |