|
|
@@ -3,6 +3,7 @@ using Avalonia.Controls;
|
|
|
using Avalonia.Controls.Notifications;
|
|
|
using Avalonia.Markup.Xaml;
|
|
|
using Avalonia.Threading;
|
|
|
+using ControlCatalog.ViewModels;
|
|
|
using System;
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
@@ -10,8 +11,6 @@ namespace ControlCatalog
|
|
|
{
|
|
|
public class MainWindow : Window
|
|
|
{
|
|
|
- private readonly NotificationManager _notificationManager = new NotificationManager();
|
|
|
-
|
|
|
public MainWindow()
|
|
|
{
|
|
|
this.InitializeComponent();
|
|
|
@@ -19,25 +18,7 @@ namespace ControlCatalog
|
|
|
//Renderer.DrawFps = true;
|
|
|
//Renderer.DrawDirtyRects = Renderer.DrawFps = true;
|
|
|
|
|
|
- Dispatcher.UIThread.InvokeAsync(async () =>
|
|
|
- {
|
|
|
- await Task.Delay(5000);
|
|
|
-
|
|
|
- _notificationManager.Show(new NotificationContent { Message = "Test1", Type = NotificationType.Information }, "Main");
|
|
|
-
|
|
|
- await Task.Delay(500);
|
|
|
- _notificationManager.Show(new NotificationContent { Message = "Test2", Type = NotificationType.Error }, "Main");
|
|
|
-
|
|
|
- await Task.Delay(500);
|
|
|
- _notificationManager.Show(new NotificationContent { Message = "Test3", Type = NotificationType.Warning }, "Main");
|
|
|
-
|
|
|
- await Task.Delay(500);
|
|
|
- _notificationManager.Show(new NotificationContent { Message = "Test4", Type = NotificationType.Success }, "Main");
|
|
|
-
|
|
|
- await Task.Delay(500);
|
|
|
- _notificationManager.Show("Test5", "Main");
|
|
|
-
|
|
|
- });
|
|
|
+ DataContext = new MainWindowViewModel();
|
|
|
}
|
|
|
|
|
|
private void InitializeComponent()
|