示例#1
0
        public ColorNode(Core.VplControl hostCanvas)
            : base(hostCanvas)
        {
            AddOutputPortToNode("Color", typeof(Color));

            expander = new ExpanderColor
            {
                Style = hostCanvas.FindResource("ExpanderColorStyle") as Style
            };

            cc = new ColorCanvas
            {
                Background  = Brushes.White,
                BorderBrush = Brushes.White
            };



            expander.Content         = cc;
            cc.SelectedColorChanged += cc_SelectedColorChanged;

            cc.SelectedColor = Colors.LightGray;

            AddControlToNode(expander);
        }
示例#2
0
        public IntegerSlider(Core.VplControl hostCanvas)
            : base(hostCanvas)
        {
            AddOutputPortToNode("Number", typeof(int));

            SliderExpanderInteger expander = new SliderExpanderInteger
            {
                Style       = hostCanvas.FindResource("ExpanderSliderStyleInteger") as Style,
                SliderValue = 5,
                SliderMax   = 10,
                SliderMin   = 0,
                SliderStep  = 1
            };

            var b2 = new Binding("Data")
            {
                Mode   = BindingMode.OneWayToSource,
                Source = OutputPorts[0]
            };

            expander.SetBinding(SliderExpanderInteger.SliderValueProperty, b2);

            Name = "Integer slider";

            AddControlToNode(expander);
        }
        public DoubleSlider(Core.VplControl hostCanvas)
            : base(hostCanvas)
        {
            AddOutputPortToNode("Number", typeof(double));

            SliderExpanderDouble expander = new SliderExpanderDouble
            {
                Style       = hostCanvas.FindResource("ExpanderSliderStyleDouble") as Style,
                SliderValue = 5,
                SliderMax   = 10,
                SliderMin   = 2,
                SliderStep  = 0.01
            };

            var b2 = new Binding("Data")
            {
                Mode   = BindingMode.OneWayToSource,
                Source = OutputPorts[0]
            };

            expander.SetBinding(SliderExpanderDouble.SliderValueProperty, b2);

            Name = "Double slider";

            AddControlToNode(expander);
        }