Param.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.ObjectModel;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using Caliburn.Micro;
  9. using Caliburn.Micro.Core;
  10. namespace RecipeEditorLib.RecipeModel.Params
  11. {
  12. public class Param : PropertyChangedBase
  13. {
  14. public Action<Param> Feedback { get; set; }
  15. public Func<Param, bool> Check { get; set; }
  16. public ObservableCollection<Param> Parent { get; set; }
  17. public virtual bool UndoChanges() { return true; }
  18. private string name;
  19. public string Name
  20. {
  21. get { return this.name; }
  22. set
  23. {
  24. this.name = value;
  25. this.NotifyOfPropertyChange("Name");
  26. }
  27. }
  28. private string _displayName;
  29. public string DisplayName
  30. {
  31. get { return this._displayName; }
  32. set
  33. {
  34. this._displayName = value;
  35. this.NotifyOfPropertyChange("DisplayName");
  36. }
  37. }
  38. private bool isEnabled;
  39. public bool IsEnabled
  40. {
  41. get
  42. {
  43. return this.isEnabled;
  44. }
  45. set
  46. {
  47. this.isEnabled = value;
  48. this.NotifyOfPropertyChange("IsEnabled");
  49. }
  50. }
  51. private bool isSaved;
  52. public bool IsSaved
  53. {
  54. get { return this.isSaved; }
  55. set
  56. {
  57. this.isSaved = value;
  58. this.NotifyOfPropertyChange("IsSaved");
  59. }
  60. }
  61. private bool _IsColumnSelected;
  62. public bool IsColumnSelected
  63. {
  64. get { return this._IsColumnSelected; }
  65. set
  66. {
  67. this._IsColumnSelected = value;
  68. this.NotifyOfPropertyChange("IsColumnSelected");
  69. }
  70. }
  71. private Visibility visibility;
  72. public Visibility Visible
  73. {
  74. get { return this.visibility; }
  75. set
  76. {
  77. this.visibility = value;
  78. this.NotifyOfPropertyChange("Visible");
  79. }
  80. }
  81. public bool EnableConfig { get; set; }
  82. public bool EnableTolerance { get; set; }
  83. public Visibility StepCheckVisibility { get; set; }
  84. public virtual void SetValue(string value)
  85. { }
  86. public Param()
  87. {
  88. this.IsSaved = true;
  89. isEnabled = true;
  90. }
  91. }
  92. }