PlatformViewModel.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. using Prism.Commands;
  2. using Prism.Mvvm;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace Venus_MainPages.ViewModels
  9. {
  10. public class PlatformViewModel : BindableBase
  11. {
  12. #region 私有字段
  13. private bool m_LoadLockDoorIsOpen;
  14. private bool m_PumpValveIsOpen;
  15. private bool m_VentValveIsOpen;
  16. private bool m_IsATM;
  17. #endregion
  18. #region 属性
  19. public bool LoadLockDoorIsOpen
  20. {
  21. get { return m_LoadLockDoorIsOpen; }
  22. set { SetProperty(ref m_LoadLockDoorIsOpen, value); }
  23. }
  24. public bool PumpValveIsOpen
  25. {
  26. get { return m_PumpValveIsOpen; }
  27. set { SetProperty(ref m_PumpValveIsOpen, value); }
  28. }
  29. public bool VentValveIsOpen
  30. {
  31. get { return m_VentValveIsOpen; }
  32. set { SetProperty(ref m_VentValveIsOpen, value); }
  33. }
  34. public bool IsATM
  35. {
  36. get { return m_IsATM; }
  37. set { SetProperty(ref m_IsATM, value); }
  38. }
  39. #endregion
  40. #region 命令
  41. //private DelegateCommand _PurgeCommand;
  42. //public DelegateCommand PurgeCommand =>
  43. // _PurgeCommand ?? (_PurgeCommand = new DelegateCommand(OnPurge));
  44. //private DelegateCommand _VentCommand;
  45. //public DelegateCommand VentCommand =>
  46. // _VentCommand ?? (_VentCommand = new DelegateCommand(OnVent));
  47. private DelegateCommand _PumpCommand;
  48. public DelegateCommand PumpCommand =>
  49. _PumpCommand ?? (_PumpCommand = new DelegateCommand(OnPump));
  50. #endregion
  51. #region 构造函数
  52. public PlatformViewModel()
  53. {
  54. m_IsATM = true;
  55. }
  56. #endregion
  57. #region 命令方法
  58. private void OnPump()
  59. {
  60. //PumpValveIsOpen = true;
  61. IsATM = !IsATM;
  62. }
  63. #endregion
  64. }
  65. }