NoticeViewModel.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. using GalaSoft.MvvmLight;
  2. using Muchinfo.MTPClient.Data.Model;
  3. namespace Muchinfo.MTPClient.Account.ViewModels
  4. {
  5. public class NoticeViewModel : ViewModelBase
  6. {
  7. private Announcement _notice;
  8. public NoticeViewModel(Announcement notice)
  9. {
  10. _notice = notice;
  11. }
  12. public Announcement Notice
  13. {
  14. get
  15. {
  16. return _notice;
  17. }
  18. set
  19. {
  20. Set(() => Notice, ref _notice, value);
  21. }
  22. }
  23. private string _noticeTitle;
  24. public string NoticeTitle
  25. {
  26. get
  27. {
  28. return Notice.Title;
  29. }
  30. set
  31. {
  32. Set(() => NoticeTitle, ref _noticeTitle, value);
  33. }
  34. }
  35. private string _noticePubExchName;
  36. public string NoticePubExchName
  37. {
  38. get
  39. {
  40. return Notice.PubExchName;
  41. }
  42. set
  43. {
  44. Set(() => NoticePubExchName, ref _noticePubExchName, value);
  45. }
  46. }
  47. private string _noticePublishDateString;
  48. public string NoticePublishDateString
  49. {
  50. get
  51. {
  52. return Notice.PublishDateString;
  53. }
  54. set
  55. {
  56. Set(() => NoticePublishDateString, ref _noticePublishDateString, value);
  57. }
  58. }
  59. private string _noticeValidDateString;
  60. public string NoticeValidDateString
  61. {
  62. get
  63. {
  64. return Notice.ValidDateString;
  65. }
  66. set
  67. {
  68. Set(() => NoticeValidDateString, ref _noticeValidDateString, value);
  69. }
  70. }
  71. private int _noticeRiskLevel;
  72. public int NoticeRiskLevel
  73. {
  74. get
  75. {
  76. return Notice.RiskLevel;
  77. }
  78. set
  79. {
  80. Set(() => NoticeRiskLevel, ref _noticeRiskLevel, value);
  81. }
  82. }
  83. }
  84. }