LoopComboxParam.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 RecipeEditorLib.DGExtension.CustomColumn;
  8. namespace RecipeEditorLib.RecipeModel.Params
  9. {
  10. public class LoopComboxParam : Param
  11. {
  12. public ObservableCollection<LoopComboxColumn.Option> Options { get; set; }
  13. private string _Value = string.Empty;
  14. public string Value
  15. {
  16. get { return this._Value; }
  17. set
  18. {
  19. this._Value = value;
  20. if (this.Feedback != null)
  21. this.Feedback(this);
  22. this.NotifyOfPropertyChange("Value");
  23. }
  24. }
  25. private bool _isEditable;
  26. public bool IsEditable
  27. {
  28. get
  29. {
  30. return _isEditable;
  31. }
  32. set
  33. {
  34. _isEditable = value;
  35. this.NotifyOfPropertyChange("IsEditable");
  36. }
  37. }
  38. private bool _isLoopStep;
  39. public bool IsLoopStep
  40. {
  41. get
  42. {
  43. return _isLoopStep;
  44. }
  45. set
  46. {
  47. _isLoopStep = value;
  48. this.NotifyOfPropertyChange("IsLoopStep");
  49. NotifyOfPropertyChange("LoopBackground");
  50. }
  51. }
  52. private bool _isValidLoop;
  53. public bool IsValidLoop
  54. {
  55. get
  56. {
  57. return _isValidLoop;
  58. }
  59. set
  60. {
  61. _isValidLoop = value;
  62. this.NotifyOfPropertyChange("IsValidLoop");
  63. NotifyOfPropertyChange("LoopBackground");
  64. }
  65. }
  66. public string LoopBackground
  67. {
  68. get
  69. {
  70. return IsLoopStep ? (IsValidLoop ? "#90EE90" : "#FFC0CB") : "Transparent";
  71. }
  72. }
  73. public bool IsLoopItem { get; set; }
  74. }
  75. }