Ejemplo n.º 1
0
        private static void OnMinValueUpdate(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            CircularSlider slider = obj as CircularSlider;

            if (slider != null)
            {
                slider.Update();
            }
        }
Ejemplo n.º 2
0
        private static void OnMinAngleUpdate(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            CircularSlider slider = obj as CircularSlider;

            if (slider != null)
            {
                if (slider.MinimumAngle > slider.MaximumAngle)
                {
                    slider.MinimumAngle = slider.MaximumAngle - 10;
                }
            }
        }
Ejemplo n.º 3
0
        private static void OnValueUpdate(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            CircularSlider slider = obj as CircularSlider;

            if (slider != null)
            {
                if (slider.Value > slider.MaximumValue)
                {
                    slider.Value = slider.MaximumValue;
                }
                if (slider.Value < slider.MinimumValue)
                {
                    slider.Value = slider.MinimumValue;
                }
                slider.Update();
            }
        }
Ejemplo n.º 4
0
        private static object OnCoerceValue(DependencyObject obj, object value)
        {
            double current = (double)value;

            CircularSlider slider = obj as CircularSlider;

            if (obj != null)
            {
                if (current < slider.MinimumValue)
                {
                    current = slider.MinimumValue;
                }
                if (current > slider.MaximumValue)
                {
                    current = slider.MaximumValue;
                }
            }

            return(current);
        }