Sic04/FrameworkLocal/UIClient/RecipeEditorLib/RecipeModel/Params/LoopComboxParam.cs

63 lines
1.5 KiB
C#
Raw Normal View History

using System.Collections.ObjectModel;
2022-09-19 09:16:33 +08:00
using RecipeEditorLib.DGExtension.CustomColumn;
namespace RecipeEditorLib.RecipeModel.Params
{
public class LoopComboxParam : ParamBaseWithGenericValue<string>
2022-09-19 09:16:33 +08:00
{
#region Constructors
public LoopComboxParam()
2022-09-19 09:16:33 +08:00
{
}
public LoopComboxParam(string initValue) : base(initValue)
{
}
#endregion
public ObservableCollection<LoopComboxColumn.Option> Options { get; set; }
2022-09-19 09:16:33 +08:00
private bool _isEditable;
public bool IsEditable
{
get => _isEditable;
2022-09-19 09:16:33 +08:00
set
{
_isEditable = value;
NotifyOfPropertyChange(nameof(IsEditable));
2022-09-19 09:16:33 +08:00
}
}
private bool _isLoopStep;
public bool IsLoopStep
{
get => _isLoopStep;
2022-09-19 09:16:33 +08:00
set
{
_isLoopStep = value;
NotifyOfPropertyChange(nameof(IsLoopStep));
NotifyOfPropertyChange(nameof(LoopBackground));
2022-09-19 09:16:33 +08:00
}
}
private bool _isValidLoop;
public bool IsValidLoop
{
get => _isValidLoop;
2022-09-19 09:16:33 +08:00
set
{
_isValidLoop = value;
NotifyOfPropertyChange(nameof(IsValidLoop));
NotifyOfPropertyChange(nameof(LoopBackground));
2022-09-19 09:16:33 +08:00
}
}
public string LoopBackground => IsLoopStep ? (IsValidLoop ? "#90EE90" : "#FFC0CB") : "Transparent";
2022-09-19 09:16:33 +08:00
public bool IsLoopItem { get; set; }
}
}