瀏覽代碼

simplify the usage of notification manager inside main window.

Dan Walmsley 6 年之前
父節點
當前提交
f09228cc48
共有 1 個文件被更改,包括 6 次插入6 次删除
  1. 6 6
      samples/ControlCatalog/ViewModels/MainWindowViewModel.cs

+ 6 - 6
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");
 
             });
         }