ClassRadSlider
Represents a slider control that allows users to select a value from a specified range. The RadSlider enables users to make precise selections by sliding a thumb along a track, with support for both single and multiple range selections. It offers various customization options for appearance and behavior, such as styling the thumbs, setting tooltips for enhanced usability, and enabling snapping to tick marks. This control provides user-friendly interaction for modifying values seamlessly within a designated range, making it suitable for applications requiring value selection with visual feedback.
Definition
Namespace:Telerik.Windows.Controls
Assembly:Telerik.Windows.Controls.dll
Syntax:
[TelerikToolboxCategory("Input")]
[Themable]
public class RadSlider : DoubleRangeBase, IRangeSelector<double>, ISupportInitialize
Inheritance: objectDoubleRangeBaseRadSlider
Derived Classes:
Implements:
Inherited Members
Constructors
RadSlider()
Initializes a new instance of the RadSlider class.
Declaration
public RadSlider()
Fields
ActiveThumbProperty
Identifies the ActiveThumb dependency property.
Declaration
public static readonly DependencyProperty ActiveThumbProperty
Field Value
DependencyProperty
AlternateThumbStyleProperty
Identifies the AlternateThumbStyle dependency property.
Declaration
public static readonly DependencyProperty AlternateThumbStyleProperty
Field Value
DependencyProperty
AutoToolTipContentTemplateProperty
Identifies the AutoToolTipTemplate dependency property.
Declaration
public static readonly DependencyProperty AutoToolTipContentTemplateProperty
Field Value
DependencyProperty
AutoToolTipPlacementProperty
Identifies the AutoToolTipPlacement dependency property.
Declaration
public static readonly DependencyProperty AutoToolTipPlacementProperty
Field Value
DependencyProperty
DecreaseHandleStyleProperty
Identifies the HandleStyle dependency property.
Declaration
public static readonly DependencyProperty DecreaseHandleStyleProperty
Field Value
DependencyProperty
DelayProperty
Identifies the Delay dependency property.
Declaration
public static readonly DependencyProperty DelayProperty
Field Value
DependencyProperty
EnableSideTicksProperty
Identifies the EnableSideTicks dependency property.
Declaration
public static readonly DependencyProperty EnableSideTicksProperty
Field Value
DependencyProperty
HandlesVisibilityProperty
Identifies the HandlesVisibility dependency property.
Declaration
public static readonly DependencyProperty HandlesVisibilityProperty
Field Value
DependencyProperty
IncreaseHandleStyleProperty
Identifies the HandleStyle dependency property.
Declaration
public static readonly DependencyProperty IncreaseHandleStyleProperty
Field Value
DependencyProperty
IsDeferredDraggingEnabledProperty
Identifies the IsDeferredDraggingEnabled dependency property.
Declaration
public static readonly DependencyProperty IsDeferredDraggingEnabledProperty
Field Value
DependencyProperty
IsDirectionReversedProperty
Identifies the IsDirectionReversed dependency property.
Declaration
public static readonly DependencyProperty IsDirectionReversedProperty
Field Value
DependencyProperty
IsMouseWheelEnabledProperty
Identifies the IsMouseWheelEnabled dependency property.
Declaration
public static readonly DependencyProperty IsMouseWheelEnabledProperty
Field Value
DependencyProperty
IsMoveToPointEnabledProperty
Identifies the IsMoveToPointEnabled dependency property.
Declaration
public static readonly DependencyProperty IsMoveToPointEnabledProperty
Field Value
DependencyProperty
IsSnapToTickEnabledProperty
Identifies the IsSnapToTickEnabled dependency property.
Declaration
public static readonly DependencyProperty IsSnapToTickEnabledProperty
Field Value
DependencyProperty
MiddleThumbClickModeProperty
Identifies the MiddleThumbClickMode dependency property.
Declaration
public static readonly DependencyProperty MiddleThumbClickModeProperty
Field Value
DependencyProperty
OrientationProperty
Identifies the Orientation dependency property.
Declaration
public static readonly DependencyProperty OrientationProperty
Field Value
DependencyProperty
RepeatIntervalProperty
Identifies the RepeatInterval dependency property.
Declaration
public static readonly DependencyProperty RepeatIntervalProperty
Field Value
DependencyProperty
ResultTicksProperty
Identifies the Ticks dependency property.
Declaration
[Browsable(false)]
public static readonly DependencyProperty ResultTicksProperty
Field Value
DependencyProperty
SelectionMiddleThumbStyleProperty
Identifies the SelectionMiddleThumbStyleProperty dependency property.
Declaration
public static readonly DependencyProperty SelectionMiddleThumbStyleProperty
Field Value
DependencyProperty
StepActionProperty
Identifies the StepAction dependency property.
Declaration
public static readonly DependencyProperty StepActionProperty
Field Value
DependencyProperty
ThumbStyleProperty
Identifies the ThumbStyle dependency property.
Declaration
public static readonly DependencyProperty ThumbStyleProperty
Field Value
DependencyProperty
ThumbToolTipStyleProperty
Identifies the ThumbToolTipStyle dependency property.
Declaration
public static readonly DependencyProperty ThumbToolTipStyleProperty
Field Value
DependencyProperty
ThumbVisibilityProperty
Identifies the ThumbVisibility dependency property.
Declaration
public static readonly DependencyProperty ThumbVisibilityProperty
Field Value
DependencyProperty
TickBarStyleProperty
Identifies the TickBarStyle dependency property.
Declaration
public static readonly DependencyProperty TickBarStyleProperty
Field Value
DependencyProperty
TickFrequencyProperty
Identifies the TickFrequency dependency property.
Declaration
public static readonly DependencyProperty TickFrequencyProperty
Field Value
DependencyProperty
TickPlacementProperty
Identifies the TickPlacement dependency property.
Declaration
public static readonly DependencyProperty TickPlacementProperty
Field Value
DependencyProperty
TickTemplateProperty
Identifies the TickTemplate dependency property.
Declaration
public static readonly DependencyProperty TickTemplateProperty
Field Value
DependencyProperty
TickTemplateSelectorProperty
Identifies the TickTemplateSelector dependency property.
Declaration
public static readonly DependencyProperty TickTemplateSelectorProperty
Field Value
DependencyProperty
TicksProperty
Identifies the Ticks dependency property.
Declaration
public static readonly DependencyProperty TicksProperty
Field Value
DependencyProperty
TrackStyleProperty
Identifies the TrackStyle dependency property.
Declaration
public static readonly DependencyProperty TrackStyleProperty
Field Value
DependencyProperty
Properties
ActiveThumb
Gets or sets the thumb from slider thumbs, that is active at the moment.
Declaration
public SliderThumbBase ActiveThumb { get; set; }
Property Value
AlternateThumbStyle
Gets or sets the style for the right Thumb used internally by the slider, in case of SelectionRangeEnabled is True.
Declaration
public Style AlternateThumbStyle { get; set; }
Property Value
Style
AutoToolTipContentTemplate
Gets or sets the template used to display the content of the RadSlider's tooltip.
Declaration
public DataTemplate AutoToolTipContentTemplate { get; set; }
Property Value
DataTemplate
AutoToolTipPlacement
Gets or sets whether a tooltip that contains the current value of the RadSlider displays when the Thumb is pressed. If a tooltip is displayed, this property also specifies the placement of the tooltip.
Declaration
public AutoToolTipPlacement AutoToolTipPlacement { get; set; }
Property Value
DecreaseHandleStyle
Gets or sets the style for the Decrease Repeat button used internally by the slider.
Declaration
public Style DecreaseHandleStyle { get; set; }
Property Value
Style
Delay
Gets or sets the Delay property of the Increase and Decrease handles.
Declaration
public int Delay { get; set; }
Property Value
Remarks
Each click on any of the handles increases/decreases the value by the amount that is set to the property.
EnableSideTicks
Gets or sets a value indicating whether side ticks are enabled.
Declaration
public bool EnableSideTicks { get; set; }
Property Value
True if side ticks are enabled; otherwise, false.
HandlesVisibility
Gets or sets the Visibility property of the Increase and Decrease handles.
Declaration
public Visibility HandlesVisibility { get; set; }
Property Value
Visibility
Remarks
Each click on any of the handles increases/decreases the value by the amount that is set to the property.
IncreaseHandleStyle
Gets or sets the style for the Increase Repeat button used internally by the slider.
Declaration
public Style IncreaseHandleStyle { get; set; }
Property Value
Style
IsDeferredDraggingEnabled
Gets or sets a value that indicates whether the content is stationary when the user drags the Thumb of RadSlider. This is dependency property.
Declaration
public bool IsDeferredDraggingEnabled { get; set; }
Property Value
IsDirectionReversed
Gets or sets the direction of increasing value. This is a dependency property.
Declaration
public bool IsDirectionReversed { get; set; }
Property Value
Remarks
The value of this property determines the direction of increasing value of a RadRadSlider.
For example, when you move the thumb control up on a vertical RadSlider when the IsDirectionReversed property is set to false, the Value of the RadSlider increases. If the value of the IsDirectionReversed property is changed to true, the of the RadSlider decreases as the thumb moves up.
IsMouseWheelEnabled
Gets or sets whether the wheel of the mouse can be used for sliding the thumb. This is dependency property.
IsMoveToPointEnabled
Gets or sets a value that indicates whether the thumb of a RadSlider moves immediately to the location of the mouse click that occurs while the mouse pointer pauses on the RadSlider track. This is a dependency property.
Declaration
public bool IsMoveToPointEnabled { get; set; }
Property Value
Remarks
When this property is set to false and a mouse click occurs along the RadSlider away from the thumb, the thumb moves in the direction of the mouse click. Instead of moving immediately to the mouse click location, the thumb moves a distance that is defined by the RepeatInterval property for each mouse click. The effect of multiple mouse clicks can be emulated by pressing and holding the left mouse button until the thumb is repositioned to the desired location.
IsSnapToTickEnabled
Gets or sets a value that indicates whether the RadSlider automatically moves the thumb to the closest tick mark. This is a dependency property.
MiddleThumbClickMode
Gets or sets a value that determines the click action of the Middle Thumb of RadSlider. This is dependency property.
Declaration
public MiddleThumbClickMode MiddleThumbClickMode { get; set; }
Property Value
Remarks
The MiddleThumbClickMode actions will take effect only in there is no drag action of the middle thumb. If the middle thumb is dragged, then no click mode action will be performed.
Orientation
Gets or sets the orientation of a RadSlider. This is a dependency property.
Declaration
public Orientation Orientation { get; set; }
Property Value
Orientation
RepeatInterval
Gets or sets the RepeatInterval property of the Increase and Decrease handles.
Declaration
public int RepeatInterval { get; set; }
Property Value
Remarks
Each click on any of the handles increases/decreases the value by the amount that is set to the property.
ResultTicks
Gets or sets the style for the border track used internally by the slider.
Declaration
[Browsable(false)]
public ObservableCollection<double> ResultTicks { get; }
Property Value
SelectionMiddleThumbStyle
Gets or sets the style for the middle Thumb used internally by the slider, in case of SelectionRangeEnabled is True.
Declaration
public Style SelectionMiddleThumbStyle { get; set; }
Property Value
Style
StepAction
This property determines how the slider will behave when in range mode. Setting this property to ChangeRange will move only the corresponding thumb when Large or Small step is performed. Setting the property to MoveRange will move the whole range when Large or Small change has been performed.
ThumbStyle
Gets or sets the style for the Thumbs used internally by the slider.
Declaration
public Style ThumbStyle { get; set; }
Property Value
Style
ThumbToolTipStyle
Gets or sets the style for the ToolTip of the Thumb used internally by the slider.
Declaration
public Style ThumbToolTipStyle { get; set; }
Property Value
Style
Remarks
The AutoToolTipPlacement property controls the Thumb ToolTip of the RadSlider.
ThumbVisibility
Gets or sets the visibility of the thumb(s) in RadSlider.
Declaration
public Visibility ThumbVisibility { get; set; }
Property Value
Visibility
Thumbs
Gets the collection that contains all the thumbs in the control.
Declaration
public ObservableCollection<SliderThumbBase> Thumbs { get; }
Property Value
TickBarStyle
Gets or sets the style for the RadTickBar used internally by the slider.
Declaration
public Style TickBarStyle { get; set; }
Property Value
Style
TickFrequency
Gets or sets the interval between tick marks. This is a dependency property.
TickPlacement
Gets or sets the position of tick marks with respect to the track of the RadSlider. This is a dependency property.
Declaration
public TickPlacement TickPlacement { get; set; }
Property Value
TickTemplate
Gets or sets the TickTemplate that will be used to represent a single tick on the TickBar.
Declaration
public DataTemplate TickTemplate { get; set; }
Property Value
DataTemplate
TickTemplateSelector
Gets or sets the TickTemplateSelector that will be used to pick a template for the tick marks.
Declaration
public DataTemplateSelector TickTemplateSelector { get; set; }
Property Value
DataTemplateSelector
Ticks
Gets or sets the positions of the tick marks to display for a RadSlider. This is a dependency property.
Declaration
public DoubleCollection Ticks { get; set; }
Property Value
DoubleCollection
TrackStyle
Gets or sets the style for the track used internally by the slider.
Declaration
public Style TrackStyle { get; set; }
Property Value
Style
Methods
BeginInit()
Begins the initialization process for the RadSlider control.
Declaration
public override void BeginInit()
Implements
Remarks
This method should be called before setting properties that affect layout or behavior, ensuring that the control is in a state suitable for configuration.
ChangeVisualState()
Changes the visual state of the control.
Declaration
protected virtual void ChangeVisualState()
ChangeVisualState(bool)
Changes the visual state of the control.
Declaration
protected virtual void ChangeVisualState(bool useTransitions)
Parameters
useTransitions
EndInit()
Finalizes the initialization process of the RadSlider control.
Declaration
public override void EndInit()
Implements
Remarks
This method is typically called after all of the properties have been set on the control.
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes (such as a rebuilding layout pass) call .
Declaration
public override void OnApplyTemplate()
Overrides
OnCreateAutomationPeer()
Creates new SliderAutomationPeer when needed.
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
AutomationPeer
OnInitialized(EventArgs)
Raises the event. This method is invoked whenever is set to true internally.
Declaration
protected override void OnInitialized(EventArgs e)
Parameters
e
The RoutedEventArgs that contains the event data.
Overrides
OnIsFocusedChanged()
Called when the is focused changes.
Declaration
protected virtual void OnIsFocusedChanged()
OnIsSelectionRangeEnabledChanged()
Called when the IsSelectionRangeEnabled property changes value.
Declaration
protected override void OnIsSelectionRangeEnabledChanged()
Overrides
OnKeyDown(KeyEventArgs)
Handles the KeyDown event for the RadSlider control, updating the value or selection based on the pressed key.
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
e
KeyEventArgs
The KeyEventArgs that contains the event data.
OnMaximumChanged(double, double)
Called when the Maximum property changes.
OnMaximumRangeSpanChanged(double, double)
Called when MaximumRangeSpanChanged event occurs.
OnMinimumChanged(double, double)
Called when the Minimum property changes.
OnMinimumRangeSpanChanged(double, double)
Called when MinimumRangeSpanChanged event occurs.
OnMouseWheel(MouseWheelEventArgs)
Invoked when an unhandled attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Declaration
protected override void OnMouseWheel(MouseWheelEventArgs e)
Parameters
e
MouseWheelEventArgs
The MouseWheelEventArgs that contains the event data.
OnOrientationChanged()
Called when the Orientation property changes value.
Declaration
protected virtual void OnOrientationChanged()
OnSelectionEndChanged(double, double)
Called when SelectionEnd changes value.
OnSelectionStartChanged(double, double)
Called when SelectionStart changes value.
OnValueChanged(double, double)
Called when the Value property changes.
UpdateTrackLayout()
This method will take the current min, max, and value to calculate and layout the current control measurements.
Declaration
protected virtual void UpdateTrackLayout()
Events
DragCompleted
Occurs when the Thumb control loses mouse capture.
Declaration
public event EventHandler<RadDragCompletedEventArgs> DragCompleted
Event Value
DragDelta
Occurs when the mouse moves while the thumb is still on focus.
Declaration
public event EventHandler<RadDragDeltaEventArgs> DragDelta
Event Value
DragStarted
Occurs when a thumb starts dragging.
Declaration
public event EventHandler<RadDragStartedEventArgs> DragStarted
Event Value