AppMessengerHelper.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using GalaSoft.MvvmLight.Messaging;
  2. using Muchinfo.MTPClient.Data.Enums;
  3. using Muchinfo.MTPClient.Data.Model;
  4. using Muchinfo.MTPClient.Data.Model.Message;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Text;
  9. using Muchinfo.MTPClient.Data.Quote;
  10. namespace Muchinfo.MTPClient.Data.Helper
  11. {
  12. /// <summary>
  13. /// 定义消息接收与发送
  14. /// </summary>
  15. public static class AppMessengerHelper
  16. {
  17. /// <summary>
  18. /// 操作变更通知
  19. /// </summary>
  20. public static class OperateChangeNotifyMessage
  21. {
  22. public static void Send(object senderName)
  23. {
  24. Messenger.Default.Send(senderName, MessengerTokens.OperateChange);
  25. }
  26. public static void Register(object recipientName, Action<string> action)
  27. {
  28. Messenger.Default.Register(recipientName, MessengerTokens.OperateChange, action);
  29. }
  30. }
  31. /// <summary>
  32. /// 开休市计划通知
  33. /// </summary>
  34. public static class MarketStatusChangeNotifyMessage
  35. {
  36. public static void Send(List<MarketTypeStatus> senderName)
  37. {
  38. Messenger.Default.Send(senderName, MessengerTokens.MarketStatusChange);
  39. }
  40. public static void Register(object recipientName, Action<List<MarketTypeStatus>> action)
  41. {
  42. Messenger.Default.Register(recipientName, MessengerTokens.MarketStatusChange, action);
  43. }
  44. }
  45. /// <summary>
  46. /// 弹出公告通知
  47. /// </summary>
  48. public static class PopupNoticeMessage
  49. {
  50. public static void Send(bool senderName)
  51. {
  52. Messenger.Default.Send(senderName, MessengerTokens.AnnouncementMessage);
  53. }
  54. public static void Register(object recipientName, Action<bool> action)
  55. {
  56. Messenger.Default.Register(recipientName, MessengerTokens.AnnouncementMessage, action);
  57. }
  58. }
  59. }
  60. }