예제 #1
0
        /// <summary>
        /// Clamp the input between min and max.
        /// </summary>
        /// <param name="d"></param>
        /// <param name="baseValue"></param>
        /// <returns></returns>
        private static object CoerceSliderValue(DependencyObject d, object baseValue)
        {
            VerticalSlider v = (VerticalSlider)d;
            double         x = (double)baseValue;

            x = x < v.Minimum ? v.Minimum : x;
            x = x > v.Maximum ? v.Maximum : x;
            return(x);
        }
예제 #2
0
        private static void OnSliderValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            VerticalSlider v = (VerticalSlider)d;

            d.CoerceValue(ValueProperty);
        }