feat: enhancement.
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.LogicalTree;
|
||||
using Avalonia.VisualTree;
|
||||
using Ursa.Controls;
|
||||
using Ursa.Demo.ViewModels;
|
||||
|
||||
@@ -11,7 +9,6 @@ namespace Ursa.Demo.Pages;
|
||||
public partial class NotificationDemo : UserControl
|
||||
{
|
||||
private NotificationDemoViewModel _viewModel;
|
||||
private TopLevel? _topLevel;
|
||||
|
||||
public NotificationDemo()
|
||||
{
|
||||
@@ -23,8 +20,8 @@ public partial class NotificationDemo : UserControl
|
||||
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
|
||||
{
|
||||
base.OnAttachedToVisualTree(e);
|
||||
_topLevel = TopLevel.GetTopLevel(this);
|
||||
_viewModel.NotificationManager = new WindowNotificationManager(_topLevel) { MaxItems = 3 };
|
||||
var topLevel = TopLevel.GetTopLevel(this);
|
||||
_viewModel.NotificationManager = new WindowNotificationManager(topLevel) { MaxItems = 3 };
|
||||
}
|
||||
|
||||
protected override void OnDetachedFromLogicalTree(LogicalTreeAttachmentEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user