private static void RangeSelected_PropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { RangeSlider slider = sender as RangeSlider; if (slider != null && !slider.internalUpdate) { slider.ReCalculateWidths(); slider.OnRangeSelectionChanged(new RangeSelectionChangedEventArgs(slider)); } }
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(); } }