Exemplo n.º 1
0
        void AddInput()
        {
            var ctrl    = new OutConnectorNode();
            var ellipse = ctrl.Control;

            ellipse.Width  = 20;
            ellipse.Height = 20;
            TopContainer.Children.Add(ellipse);

            Canvas.SetLeft(ellipse, 150 + 40 * _inputNodes.Count);
            Canvas.SetBottom(ellipse, ellipse.Height);
            _inputNodes.Add(ctrl);

            DeleteInputButton.IsEnabled = true;
            AddInputButton.IsEnabled    = _inputNodes.Count < 8;
        }
Exemplo n.º 2
0
        protected override UIElement CreateContent()
        {
            var sp = new StackPanel();

            sp.VerticalAlignment = VerticalAlignment.Center;
            var tbTrue = new TextBlock();

            tbTrue.HorizontalAlignment = HorizontalAlignment.Center;
            tbTrue.Text   = "If true";
            tbTrue.Margin = new Thickness(5);
            sp.Children.Add(tbTrue);
            ifBlock = new OutConnectorNode();
            sp.Children.Add(ifBlock.Control);
            var tbFalse = new TextBlock();

            tbFalse.HorizontalAlignment = HorizontalAlignment.Center;
            tbFalse.Text   = "If false";
            tbFalse.Margin = new Thickness(5);
            sp.Children.Add(tbFalse);
            elseBlock = new OutConnectorNode();
            sp.Children.Add(elseBlock.Control);
            return(sp);
        }