Version

Retrieve the Thumb Values

You can retrieve the value of the thumb on your single value sliders by using the Thumb property.

You can retrieve the value of a thumb on your range sliders by accessing the Thumbs collection.

Since the xamSlider™ control does inherit from ItemsControl, the thumbs can only be accessed by the index. They cannot be accessed by the name of the thumb.

The following code demonstrates how to retrieve the thumb values.

In Visual Basic:

' Single Value Slider
Dim SingleValueSliderValue As Double = Me.xamNumericSlider1.Thumb.Value
' Range Slider
Dim RangeSliderValue As Double = Me.xamNumericRangeSlider1.Thumbs(0).Value
' Single Value Date Time Slider
Dim SingleValueDateTimeSlider As DateTime = Me.xamDateTimeSlider1.Thumb.Value
' Accessing the first thumb on a date time range slider
Dim RangeDateTimeSlider As DateTime = Me.xamDateTimeRangeSlider1.Thumbs(0).Value
' Accessing the second thumb on a date time range slider
Dim RangeDateTimeSlider1 As DateTime = Me.xamDateTimeRangeSlider1.Thumbs(1).Value

In C#:

// Single Value Slider
double SingleValueSliderValue = this.xamNumericSlider1.Thumb.Value;
// Accessing the first thumb on a range slider
double RangeSliderValue = this.xamNumericRangeSlider1.Thumbs[0].Value;
// Accessing the third thumb on a range slider
double RangeSliderValue = this.xamNumericRangeSlider1.Thumbs[2].Value;
// Single Value Date Time Slider
DateTime SingleValueDateTimeSlider = this.xamDateTimeSlider1.Thumb.Value;
// Accessing the first thumb on a date time range slider
DateTime RangeDateTimeSlider = this.xamDateTimeRangeSlider1.Thumbs[0].Value;
// Accessing the second thumb on a date time range slider
DateTime RangeDateTimeSlider1 = this.xamDateTimeRangeSlider1.Thumbs[1].Value;