MessageBoxEx.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Windows.Media;
  6. namespace Aitex.Core.UI.Dialog
  7. {
  8. public class MessageBoxEx
  9. {
  10. /// <summary>
  11. /// show information dialog
  12. /// </summary>
  13. /// <param name="infoTitle">information title string</param>
  14. /// <param name="infoContent">information content string</param>
  15. public static void ShowInfo(string infoTitle, string infoContent)
  16. {
  17. NotificationDialog dlg = new NotificationDialog() { MessageTitle = infoTitle, MessageContent = infoContent, BannerColor = Brushes.DodgerBlue };
  18. dlg.Show();
  19. }
  20. /// <summary>
  21. /// show warning dialog
  22. /// </summary>
  23. /// <param name="infoTitle">information title string</param>
  24. /// <param name="infoContent">information content string</param>
  25. public static void ShowWarning(string infoTitle, string infoContent)
  26. {
  27. NotificationDialog dlg = new NotificationDialog() { MessageTitle = infoTitle, MessageContent = infoContent, BannerColor = Brushes.Gold };
  28. dlg.Show();
  29. }
  30. /// <summary>
  31. /// show error dialog
  32. /// </summary>
  33. /// <param name="infoTitle">information title string</param>
  34. /// <param name="infoContent">information content string</param>
  35. public static void ShowError(string infoTitle, string infoContent)
  36. {
  37. NotificationDialog dlg = new NotificationDialog() { MessageTitle = infoTitle, MessageContent = infoContent, BannerColor = Brushes.Red };
  38. dlg.Show();
  39. }
  40. }
  41. }