コード例 #1
0
        private void BindingCadObject(LProjectionSetting projectionSetting)
        {
            CRSUpDn.DataContext = projectionSetting.PointStep;
            CRSUpDn.SetBinding(NumericUpDown.ValueProperty, "MX");
            projectionSetting.PointStep.PropertyChanged += M_ChangePoint;

            RadiusSlider.Value       = projectionSetting.RadiusEdge;
            RadiusSlider.DataContext = projectionSetting;
            RadiusSlider.SetBinding(Slider.ValueProperty, "RadiusEdge");
            MonchaHub.Size.PropertyChanged += Size_ChangePoint;

            MultiplierSlider.Value       = projectionSetting.StartLineWait;
            MultiplierSlider.DataContext = projectionSetting;
            MultiplierSlider.SetBinding(Slider.ValueProperty, "StartLineWait");

            DistanceUpDn.DataContext = projectionSetting;
            DistanceUpDn.SetBinding(NumericUpDown.ValueProperty, "Distance");

            RedUpDn.DataContext = projectionSetting;
            RedUpDn.SetBinding(NumericUpDown.ValueProperty, "Red");

            RedToggle.DataContext = projectionSetting;
            RedToggle.SetBinding(ToggleSwitch.IsOnProperty, "RedOn");

            GreenUpDn.DataContext = projectionSetting;
            GreenUpDn.SetBinding(NumericUpDown.ValueProperty, "Green");

            GreenToggle.DataContext = projectionSetting;
            GreenToggle.SetBinding(ToggleSwitch.IsOnProperty, "GreenOn");

            BlueUpDn.DataContext = projectionSetting;
            BlueUpDn.SetBinding(NumericUpDown.ValueProperty, "Blue");

            BlueToggle.DataContext = projectionSetting;
            BlueToggle.SetBinding(ToggleSwitch.IsOnProperty, "BlueOn");

            DeviceLayerCombo.Items.Clear();
            DeviceLayerCombo.DisplayMemberPath = "HWIdentifier";
            DeviceLayerCombo.Items.Add(null);
            foreach (MonchaDevice device in MonchaHub.Devices)
            {
                DeviceLayerCombo.Items.Add(device);
            }

            projectionSetting.PropertyChanged           += ProjectionSetting_PropertyChanged;
            projectionSetting.PointStep.PropertyChanged += ProjectionSetting_PropertyChanged;
        }
コード例 #2
0
 private void M_ChangePoint(object sender, PropertyChangedEventArgs e)
 {
     CRSUpDn.SetBinding(NumericUpDown.ValueProperty, "PointStep");
 }