LimitModel.cs 1.0 KB

123456789101112131415161718192021222324252627
  1. using SWRIS.Enums;
  2. using System.ComponentModel;
  3. namespace SWRIS.Models
  4. {
  5. public class LimitModel : INotifyPropertyChanged
  6. {
  7. private string name;
  8. private LimitState state;
  9. private int switchIndex = 0;
  10. private bool isEnable;
  11. public string Name { get => name; set { name = value; OnPropertyChanged("Name"); } }
  12. public LimitState State { get => state; set { state = value; OnPropertyChanged("State"); } }
  13. /// <summary>
  14. /// 限位开关索引,0无 1位置1 2位置2
  15. /// </summary>
  16. public int SwitchIndex { get => switchIndex; set { switchIndex = value; OnPropertyChanged("SwitchIndex"); } }
  17. public bool IsEnable { get => isEnable; set { isEnable = value; OnPropertyChanged("IsEnable"); } }
  18. public event PropertyChangedEventHandler PropertyChanged;
  19. protected internal virtual void OnPropertyChanged(string propertyName)
  20. {
  21. PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
  22. }
  23. }
  24. }