private void AdjustWidths(double minimum, double maximum, double lowerValue, double higherValue)
{
double actualWidth = 0;
double lowerSliderThumbWidth = 0d;
double higherSliderThumbWidth = 0d;
if (this.Orientation == OrientationEnum.Horizontal)
{
actualWidth = this.ActualWidth;
lowerSliderThumbWidth = RangeSlider.GetThumbWidth(_lowerSlider);
higherSliderThumbWidth = RangeSlider.GetThumbWidth(_higherSlider);
}
else if (this.Orientation == OrientationEnum.Vertical)
{
actualWidth = this.ActualHeight;
lowerSliderThumbWidth = RangeSlider.GetThumbHeight(_lowerSlider);
higherSliderThumbWidth = RangeSlider.GetThumbHeight(_higherSlider);
}
actualWidth -= (lowerSliderThumbWidth + higherSliderThumbWidth);
double entireRange = maximum - minimum;
this.HigherRangeWidth = (actualWidth * (maximum - higherValue)) / entireRange;
this.RangeWidth = (actualWidth * (higherValue - lowerValue)) / entireRange;
this.LowerRangeWidth = (actualWidth * (lowerValue - minimum)) / entireRange;
}