using System.Collections.ObjectModel;
using MECF.Framework.UI.Client.RecipeEditorLib.DGExtension.CustomColumn;

namespace MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel.Params
{
    public class LoopComboxParam : ParamBaseWithGenericValue<string>
    {

        #region Constructors

        public LoopComboxParam()
        {
        }

        public LoopComboxParam(string initValue) : base(initValue)
        {
        }

        #endregion

        public ObservableCollection<LoopComboxColumn.Option> Options { get; set; }

        private bool _isEditable;
        public bool IsEditable
        {
            get => _isEditable;
            set => Set(ref _isEditable, value);
        }

        private bool _isLoopStep;
        public bool IsLoopStep
        {
            get => _isLoopStep;
            set
            {
                Set(ref _isLoopStep, value);
                OnPropertyChanged(nameof(LoopBackground));
            }
        }

        private bool _isValidLoop;
        public bool IsValidLoop
        {
            get => _isValidLoop;
            set
            {
                Set(ref _isValidLoop, value);
                OnPropertyChanged(nameof(LoopBackground));
            }
        }

        public string LoopBackground => IsLoopStep ? (IsValidLoop ? "#90EE90" : "#FFC0CB") : "Transparent";


        public bool IsLoopItem { get; set; }
    }
}
