KeyAndValueDto.cs 988 B

123456789101112131415161718192021222324252627282930313233343536
  1. using System.ComponentModel;
  2. namespace SWRIS.Dtos
  3. {
  4. public class KeyAndValueDto : INotifyPropertyChanged
  5. {
  6. private int? key;
  7. private string value;
  8. public int? Key
  9. {
  10. get { return key; }
  11. set { key = value; OnPropertyChanged("Key"); }
  12. }
  13. public string Value
  14. {
  15. get { return this.value; }
  16. set { this.value = value; OnPropertyChanged("Value"); }
  17. }
  18. public event PropertyChangedEventHandler PropertyChanged;
  19. protected internal virtual void OnPropertyChanged(string propertyName)
  20. {
  21. PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
  22. }
  23. }
  24. public class KeyAndValueWithChecked : KeyAndValueDto
  25. {
  26. private bool isChecked;
  27. public bool IsChecked {
  28. get { return isChecked; }
  29. set { isChecked = value; OnPropertyChanged("IsChecked"); }
  30. }
  31. }
  32. }