Exemplo n.º 1
0
        private static void OnMinimumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RangeBase <T> rangeBase = (RangeBase <T>)d;

            rangeBase.CoerceValue(RangeBase <T> .MaximumProperty);
            rangeBase.CoerceValue(RangeBase <T> .ValueProperty);
            rangeBase.OnMinimumChanged((T)e.OldValue, (T)e.NewValue);
        }
Exemplo n.º 2
0
        internal static object ConstrainToRange(DependencyObject d, object value)
        {
            RangeBase <T> rangeBase = (RangeBase <T>)d;
            T             minimum   = rangeBase.Minimum;
            T             num       = (T)value;

            if (num.CompareTo(minimum) < 0)
            {
                return(minimum);
            }
            T maximum = rangeBase.Maximum;

            if (num.CompareTo(maximum) > 0)
            {
                return(maximum);
            }
            else
            {
                return(value);
            }
        }
Exemplo n.º 3
0
        private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RangeBase <T> rangeBase = (RangeBase <T>)d;

            rangeBase.OnValueChanged((T)e.OldValue, (T)e.NewValue);
        }