Пример #1
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="condition">The <see cref="ICondition"/> that should be represented visually</param>
        public ComplexConditionViewModel(ICondition condition)
        {
            Condition = condition;

            Condition.Children?.ForEach(cond =>
            {
                if (cond is SimpleCondition)
                {
                    Children.Add(new SimpleConditionViewModel(cond));
                }
                else if (cond is ComplexCondition)
                {
                    Children.Add(new ComplexConditionViewModel(cond));
                }
            });
            Condition.LogicOperators?.ForEach(logOp =>
            {
                LogicOperators.Add(logOp);
            });

            ExpandCommand = new RelayCommand(Expand, CanExpand);
        }