5 changed files with 49 additions and 37 deletions
@ -1,18 +1,33 @@ |
|||||
|
using Avalonia; |
||||
using Avalonia.Controls; |
using Avalonia.Controls; |
||||
using Avalonia.Markup.Xaml; |
using Avalonia.Markup.Xaml; |
||||
|
using ControlCatalog.ViewModels; |
||||
|
|
||||
namespace ControlCatalog.Pages |
namespace ControlCatalog.Pages |
||||
{ |
{ |
||||
public class NotificationsPage : UserControl |
public class NotificationsPage : UserControl |
||||
{ |
{ |
||||
|
private NotificationViewModel _viewModel; |
||||
|
|
||||
public NotificationsPage() |
public NotificationsPage() |
||||
{ |
{ |
||||
this.InitializeComponent(); |
this.InitializeComponent(); |
||||
|
|
||||
|
_viewModel = new NotificationViewModel(); |
||||
|
|
||||
|
DataContext = _viewModel; |
||||
} |
} |
||||
|
|
||||
private void InitializeComponent() |
private void InitializeComponent() |
||||
{ |
{ |
||||
AvaloniaXamlLoader.Load(this); |
AvaloniaXamlLoader.Load(this); |
||||
} |
} |
||||
|
|
||||
|
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e) |
||||
|
{ |
||||
|
base.OnAttachedToVisualTree(e); |
||||
|
|
||||
|
_viewModel.NotificationManager = (VisualRoot as TopLevel)?.NotificationManager; |
||||
|
} |
||||
} |
} |
||||
} |
} |
||||
|
|||||
Loading…
Reference in new issue