示例#1
0
        private static void OnIsAutoChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ValueControl control = d as ValueControl;

            control.slider.IsEnabled       = !control.IsAuto;
            control.doubleUpDown.IsEnabled = !control.IsAuto;
        }
示例#2
0
        private static void OnMinValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ValueControl control = d as ValueControl;

            if (control.IsInitialized)
            {
                if (control.IsLogarithm)
                {
                    control.slider.Minimum = Math.Log10(control.MinValue);
                }
                else
                {
                    control.slider.Minimum = control.MinValue;
                }
            }
        }
示例#3
0
        private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ValueControl control = d as ValueControl;

            if (control.IsInitialized)
            {
                control.slider.ValueChanged -= control.slider_ValueChanged;
                if (control.IsLogarithm)
                {
                    control.slider.Value = Math.Log10(control.Value);
                }
                else
                {
                    control.slider.Value = control.Value;
                }
                control.slider.ValueChanged += control.slider_ValueChanged;
            }

            control.ValueChanged?.Invoke(control);
        }