feat: add new Notification.
This commit is contained in:
25
demo/Ursa.Demo/Pages/NotificationDemo.axaml.cs
Normal file
25
demo/Ursa.Demo/Pages/NotificationDemo.axaml.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Ursa.Controls;
|
||||
using Ursa.Demo.ViewModels;
|
||||
|
||||
namespace Ursa.Demo.Pages;
|
||||
|
||||
public partial class NotificationDemo : UserControl
|
||||
{
|
||||
private NotificationDemoViewModel _viewModel;
|
||||
|
||||
public NotificationDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
_viewModel = new NotificationDemoViewModel();
|
||||
DataContext = _viewModel;
|
||||
}
|
||||
|
||||
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
|
||||
{
|
||||
base.OnAttachedToVisualTree(e);
|
||||
var topLevel = TopLevel.GetTopLevel(this);
|
||||
_viewModel.NotificationManager = new WindowNotificationManager(topLevel) { MaxItems = 3 };
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user