Exemple #1
0
        private static void Range_PropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            RangeSlider slider = sender as RangeSlider;

            if (slider != null && !slider.internalUpdate)
            {
                slider.ReCalculateRanges();
                slider.ReCalculateWidths();
            }
        }
Exemple #2
0
        private static void MinRange_PropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            if ((long)e.NewValue < 0)
            {
                throw new ArgumentOutOfRangeException("value", "value for MinRange cannot be less than 0");
            }

            RangeSlider slider = sender as RangeSlider;

            if (slider != null && !slider.internalUpdate)
            {
                slider.internalUpdate    = true;//set flag to signal that the properties are being set by the object itself
                slider.RangeStopSelected = Math.Max(slider.RangeStopSelected, slider.RangeStartSelected + (long)e.NewValue);
                slider.RangeStop         = Math.Max(slider.RangeStop, slider.RangeStopSelected);
                slider.internalUpdate    = false;//set flag to signal that the properties are being set by the object itself

                slider.ReCalculateRanges();
                slider.ReCalculateWidths();
            }
        }