Descriptions.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace OUP.ForOUP
  8. {
  9. class Descriptions: INotifyPropertyChanged
  10. {
  11. private bool _isDone;
  12. private string _prod;
  13. private string _description;
  14. public string Product
  15. {
  16. get { return _prod; }
  17. set {
  18. if (_prod == value)
  19. return;
  20. _prod = value;
  21. OnPropertyChanged("Product");
  22. }
  23. }
  24. public DateTime Date { get; set; } = DateTime.Now;
  25. public bool IsDone
  26. {
  27. get { return _isDone; }
  28. set
  29. {
  30. if (_isDone == value)
  31. return;
  32. _isDone = value;
  33. OnPropertyChanged("IsDone");
  34. }
  35. }
  36. public string Description
  37. {
  38. get { return _description; }
  39. set {
  40. if (_description == value)
  41. return;
  42. _description = value;
  43. OnPropertyChanged("Description");
  44. _description = value;
  45. }
  46. }
  47. public event PropertyChangedEventHandler PropertyChanged;
  48. protected virtual void OnPropertyChanged(string propertyName = "")
  49. {
  50. PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
  51. }
  52. }
  53. }