NotificationUtil.cs 1020 B

1234567891011121314151617181920212223242526272829
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using WPFNotification.Core.Configuration;
  7. using WPFNotification.Model;
  8. using WPFNotification.Services;
  9. namespace DeviceCenter.utils
  10. {
  11. class NotificationUtil
  12. {
  13. private static readonly INotificationDialogService notificationService = new NotificationDialogService();
  14. public static void show(string title, string message)
  15. {
  16. var notificationConfiguration = NotificationConfiguration.DefaultConfiguration;
  17. notificationConfiguration.NotificationFlowDirection = NotificationFlowDirection.RightBottom;
  18. var newNotification = new Notification()
  19. {
  20. Title = title,
  21. Message = message
  22. // ,ImgURL = "pack://application:,,,a/Resources/Images/warning.png"
  23. };
  24. notificationService.ShowNotificationWindow(newNotification, notificationConfiguration);
  25. }
  26. }
  27. }