mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-04-04 08:06:36 +08:00
feat: add notification card and notification manager
This commit is contained in:
@@ -1,13 +1,29 @@
|
||||
using System.Diagnostics;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Notifications;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Layout;
|
||||
using Avalonia.VisualTree;
|
||||
|
||||
namespace Semi.Avalonia.Demo
|
||||
{
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user