Xceed.Wpf.Toolkit.RangeSlider.GetThumbHeight C# (CSharp) Method

GetThumbHeight() static private method

static private GetThumbHeight ( System.Windows.Controls.Slider slider ) : double
slider System.Windows.Controls.Slider
return double
      internal static double GetThumbHeight( Slider slider )
      {
        if( slider != null )
        {
          var track = ( Track )slider.Template.FindName( "PART_Track", slider );
          if( track != null )
          {
            var thumb = track.Thumb;
            return thumb.ActualHeight;
          }
        }
        return 0d;
      }

Usage Example

Exemplo n.º 1
0
        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;
        }
All Usage Examples Of Xceed.Wpf.Toolkit.RangeSlider::GetThumbHeight