示例#1
0
        public void AddTextConditional()
        {
            var ret = new ConditionalBlockModel(TextBlockContainer.Items);

            TextBlockContainer.Items.Add(ret);
            TextBlockContainer.Items.SelectedItem = ret;
        }
示例#2
0
        public ConditionalBlockModel(ConditionalBlockModel conditional, IdeCollection <IdeBaseItem> source) : base(source) //copy
        {
            _wrapper = new LinkDefinition.LinkWrapper()
            {
                Conditional = new ConditionalDefinition()
            };

            Items = new IdeCollection <IdeBaseItem>(this, typeof(IBaseConditionalCase));
            Items.CollectionChanged += (a, b) =>
            {
                BuildConditionalDefinitions(b);
            };
            foreach (IBaseConditionalCase caseItem in conditional.Items)
            {
                if (caseItem is IfCaseModel ifCase)
                {
                    Items.Add(new IfCaseModel(ifCase, Items));
                }
                if (caseItem is ElseIfCaseModel elseIfCase)
                {
                    Items.Add(new ElseIfCaseModel(elseIfCase, Items));
                }
                if (caseItem is ElseCaseModel elseCase)
                {
                    Items.Add(new ElseCaseModel(elseCase, Items));
                }
            }
            AddElseIfCommand = new RelayCommand(AddElseIf);
            AddElseCommand   = new RelayCommand(AddElse);
        }
示例#3
0
        public void AddOverlayConditional()
        {
            var ret = new ConditionalBlockModel(OverlayContainer.Items);

            OverlayContainer.Items.Add(ret);
            OverlayContainer.Items.SelectedItem = ret;
        }