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);
        }
Beispiel #2
0
        public DoublePort(string name, PortTypes portType, Type type, VplControl.Core.VplControl hostCanvas) : base(name, portType, type, hostCanvas)
        {
            // Set the DataType
            DataType = typeof(double);

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

            var binding = new Binding("Data")
            {
                Mode   = BindingMode.OneWayToSource,
                Source = this
            };

            doubleSlider.SetBinding(SliderExpanderDouble.SliderValueProperty, binding);

            AddPopupContent(doubleSlider);
        }