CompDetailItem.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. using MeterVision.db;
  2. using MeterVision.Util;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows;
  10. namespace MeterVision.model
  11. {
  12. public class CompDetailItem : INotifyPropertyChanged
  13. {
  14. public event PropertyChangedEventHandler PropertyChanged;
  15. protected void OnPropertyChanged(string propertyName)
  16. {
  17. PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
  18. }
  19. private int _index;
  20. public int Index
  21. {
  22. get => _index;
  23. set
  24. {
  25. if (_index != value)
  26. {
  27. _index = value;
  28. OnPropertyChanged(nameof(Index));
  29. }
  30. }
  31. }
  32. public Visibility ResultVisiable
  33. {
  34. get => Visibility.Visible;
  35. }
  36. public string CompId { get; set; }
  37. public string CreateTime { get; set; }
  38. public string NPatchId { get; set; }
  39. public string OPatchId { get; set; }
  40. public string StandId { get; set; }
  41. //private PatchDetailItem _detail1;
  42. //public PatchDetailItem Detail1
  43. //{
  44. // get => _detail1;
  45. // set
  46. // {
  47. // if(_detail1 != value)
  48. // {
  49. // _detail1 = value;
  50. // OnPropertyChanged(nameof(Detail1));
  51. // }
  52. // }
  53. //}
  54. //private PatchDetailItem _detail2;
  55. //public PatchDetailItem Detail2
  56. //{
  57. // get => _detail2;
  58. // set
  59. // {
  60. // if (_detail2 != value)
  61. // {
  62. // _detail2 = value;
  63. // OnPropertyChanged(nameof(Detail2));
  64. // }
  65. // }
  66. //}
  67. public PatchDetailItem Detail1 { get; set; }
  68. public PatchDetailItem Detail2 { get; set; }
  69. public CompDetailItem(VCompDetail compDetail)
  70. {
  71. ObjectHelper.CopyMatchingFields(compDetail, this);
  72. Detail1 = new PatchDetailItem(compDetail.PatchDetail1);
  73. Detail2 = new PatchDetailItem(compDetail.PatchDetail2);
  74. }
  75. //----------------------------------------
  76. }
  77. }