From f09228cc483d015bfc747d0efd22b6bb889dc7e6 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Wed, 1 May 2019 20:34:36 +0100 Subject: [PATCH] simplify the usage of notification manager inside main window. --- .../ControlCatalog/ViewModels/MainWindowViewModel.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/samples/ControlCatalog/ViewModels/MainWindowViewModel.cs b/samples/ControlCatalog/ViewModels/MainWindowViewModel.cs index 7a02f5a45c..f66625ea82 100644 --- a/samples/ControlCatalog/ViewModels/MainWindowViewModel.cs +++ b/samples/ControlCatalog/ViewModels/MainWindowViewModel.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; @@ -24,19 +24,19 @@ namespace ControlCatalog.ViewModels await Task.Delay(5000); - Application.Current.MainWindow.LocalNotificationManager.Show(new NotificationViewModel { Title = "Warning", Message = "Please save your work before closing." }); + NotificationManager.Show(new NotificationViewModel { Title = "Warning", Message = "Please save your work before closing." }); await Task.Delay(1500); - Application.Current.MainWindow.LocalNotificationManager.Show(new NotificationContent { Message = "Test2", Type = NotificationType.Error }); + NotificationManager.Show(new NotificationContent { Message = "Test2", Type = NotificationType.Error }); await Task.Delay(2000); - Application.Current.MainWindow.LocalNotificationManager.Show(new NotificationContent { Message = "Test3", Type = NotificationType.Warning }); + NotificationManager.Show(new NotificationContent { Message = "Test3", Type = NotificationType.Warning }); await Task.Delay(2500); - Application.Current.MainWindow.LocalNotificationManager.Show(new NotificationContent { Message = "Test4", Type = NotificationType.Success }); + NotificationManager.Show(new NotificationContent { Message = "Test4", Type = NotificationType.Success }); await Task.Delay(500); - Application.Current.MainWindow.LocalNotificationManager.Show("Test5"); + NotificationManager.Show("Test5"); }); }