SensorModel.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. 
  2. using System.ComponentModel;
  3. using System.Runtime.CompilerServices;
  4. namespace SWRIS.Models
  5. {
  6. public class SensorModel : INotifyPropertyChanged
  7. {
  8. private int _id;
  9. private string _name;
  10. private string _color;
  11. private bool _isActive = false;
  12. public int Id
  13. {
  14. get => _id;
  15. set { _id = value; OnPropertyChanged(); }
  16. }
  17. public string Name
  18. {
  19. get => _name;
  20. set { _name = value; OnPropertyChanged(); }
  21. }
  22. public string Color
  23. {
  24. get => _color;
  25. set { _color = value; OnPropertyChanged(); }
  26. }
  27. public bool IsActive
  28. {
  29. get => _isActive;
  30. set { _isActive = value; OnPropertyChanged(); }
  31. }
  32. public event PropertyChangedEventHandler PropertyChanged;
  33. protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
  34. {
  35. PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
  36. }
  37. }
  38. }