mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-04-14 05:06:35 +08:00
feat: add sample in web app.
This commit is contained in:
23
demo/Semi.Avalonia.Demo/Views/MainWindow.axaml.cs
Normal file
23
demo/Semi.Avalonia.Demo/Views/MainWindow.axaml.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user