Beispiel #1
0
        private static object CoerceMinimumValue(DependencyObject d, object baseValue)
        {
            RotaryValue rotary = (RotaryValue)d;

            int newValue = (int)baseValue;

            if (newValue < rotary.MinimumScale)
            {
                newValue = rotary.MinimumScale;
            }

            return(newValue);
        }
        private static object CoerceMinimum(DependencyObject d, object baseValue)
        {
            RotaryValue rotary = (RotaryValue)d;

            int newValue = (int)baseValue;

            if (newValue > rotary.Maximum)
            {
                newValue = rotary.Maximum;
            }

            return(newValue);
        }
        private static object CoerceValue(DependencyObject d, object baseValue)
        {
            RotaryValue rotary = (RotaryValue)d;
            int         min    = rotary.Minimum;
            int         max    = rotary.Maximum;

            int newValue = (int)baseValue;

            if (newValue < min)
            {
                newValue = min;
            }
            else if (newValue > max)
            {
                newValue = max;
            }

            return(newValue);
        }
 public void SetValueIndex(int index)
 {
     SelectedValue = RotaryValues[index];
     SelectedIndex = index;
 }