Beispiel #1
0
        private static object CoerceDefaultValue(DependencyObject d, object baseValue)
        {
            ExtendedSlider ctrl  = (ExtendedSlider)d;
            double         value = (double)baseValue;

            double min = ctrl.Minimum;

            if (value < min)
            {
                return(min);
            }

            double max = ctrl.Maximum;

            if (value > max)
            {
                return(max);
            }

            return(value);
        }
Beispiel #2
0
        private static void OnDefaultValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ExtendedSlider ctrl = (ExtendedSlider)d;

            ctrl.OnDefaultValueChanged((double)e.OldValue, (double)e.NewValue);
        }