RadSlider
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
Initializes a new instance of the RadSlider class.
public RadSlider()
Fields
ActiveThumbProperty
DependencyProperty
Identifies the ActiveThumb dependency property.
public static readonly DependencyProperty ActiveThumbProperty
AlternateThumbStyleProperty
DependencyProperty
Identifies the AlternateThumbStyle dependency property.
public static readonly DependencyProperty AlternateThumbStyleProperty
AutoToolTipContentTemplateProperty
DependencyProperty
Identifies the AutoToolTipTemplate dependency property.
public static readonly DependencyProperty AutoToolTipContentTemplateProperty
AutoToolTipPlacementProperty
DependencyProperty
Identifies the AutoToolTipPlacement dependency property.
public static readonly DependencyProperty AutoToolTipPlacementProperty
DecreaseHandleStyleProperty
DependencyProperty
Identifies the HandleStyle dependency property.
public static readonly DependencyProperty DecreaseHandleStyleProperty
DelayProperty
DependencyProperty
Identifies the Delay dependency property.
public static readonly DependencyProperty DelayProperty
EnableSideTicksProperty
DependencyProperty
Identifies the EnableSideTicks dependency property.
public static readonly DependencyProperty EnableSideTicksProperty
HandlesVisibilityProperty
DependencyProperty
Identifies the HandlesVisibility dependency property.
public static readonly DependencyProperty HandlesVisibilityProperty
IncreaseHandleStyleProperty
DependencyProperty
Identifies the HandleStyle dependency property.
public static readonly DependencyProperty IncreaseHandleStyleProperty
IsDeferredDraggingEnabledProperty
DependencyProperty
Identifies the IsDeferredDraggingEnabled dependency property.
public static readonly DependencyProperty IsDeferredDraggingEnabledProperty
IsDirectionReversedProperty
DependencyProperty
Identifies the IsDirectionReversed dependency property.
public static readonly DependencyProperty IsDirectionReversedProperty
IsMouseWheelEnabledProperty
DependencyProperty
Identifies the IsMouseWheelEnabled dependency property.
public static readonly DependencyProperty IsMouseWheelEnabledProperty
IsMoveToPointEnabledProperty
DependencyProperty
Identifies the IsMoveToPointEnabled dependency property.
public static readonly DependencyProperty IsMoveToPointEnabledProperty
IsSnapToTickEnabledProperty
DependencyProperty
Identifies the IsSnapToTickEnabled dependency property.
public static readonly DependencyProperty IsSnapToTickEnabledProperty
MiddleThumbClickModeProperty
DependencyProperty
Identifies the MiddleThumbClickMode dependency property.
public static readonly DependencyProperty MiddleThumbClickModeProperty
OrientationProperty
DependencyProperty
Identifies the Orientation dependency property.
public static readonly DependencyProperty OrientationProperty
RepeatIntervalProperty
DependencyProperty
Identifies the RepeatInterval dependency property.
public static readonly DependencyProperty RepeatIntervalProperty
ResultTicksProperty
DependencyProperty
Identifies the Ticks dependency property.
[Browsable(false)]
public static readonly DependencyProperty ResultTicksProperty
SelectionMiddleThumbStyleProperty
DependencyProperty
Identifies the SelectionMiddleThumbStyleProperty dependency property.
public static readonly DependencyProperty SelectionMiddleThumbStyleProperty
StepActionProperty
DependencyProperty
Identifies the StepAction dependency property.
public static readonly DependencyProperty StepActionProperty
ThumbStyleProperty
DependencyProperty
Identifies the ThumbStyle dependency property.
public static readonly DependencyProperty ThumbStyleProperty
ThumbToolTipStyleProperty
DependencyProperty
Identifies the ThumbToolTipStyle dependency property.
public static readonly DependencyProperty ThumbToolTipStyleProperty
ThumbVisibilityProperty
DependencyProperty
Identifies the ThumbVisibility dependency property.
public static readonly DependencyProperty ThumbVisibilityProperty
TickBarStyleProperty
DependencyProperty
Identifies the TickBarStyle dependency property.
public static readonly DependencyProperty TickBarStyleProperty
TickFrequencyProperty
DependencyProperty
Identifies the TickFrequency dependency property.
public static readonly DependencyProperty TickFrequencyProperty
TickPlacementProperty
DependencyProperty
Identifies the TickPlacement dependency property.
public static readonly DependencyProperty TickPlacementProperty
TicksProperty
DependencyProperty
Identifies the Ticks dependency property.
public static readonly DependencyProperty TicksProperty
TickTemplateProperty
DependencyProperty
Identifies the TickTemplate dependency property.
public static readonly DependencyProperty TickTemplateProperty
TickTemplateSelectorProperty
DependencyProperty
Identifies the TickTemplateSelector dependency property.
public static readonly DependencyProperty TickTemplateSelectorProperty
TrackStyleProperty
DependencyProperty
Identifies the TrackStyle dependency property.
public static readonly DependencyProperty TrackStyleProperty
Properties
Gets or sets the thumb from slider thumbs, that is active at the moment.
public SliderThumbBase ActiveThumb { get; set; }
AlternateThumbStyle
Style
Gets or sets the style for the right Thumb used internally by the slider, in case of SelectionRangeEnabled is True.
public Style AlternateThumbStyle { get; set; }
AutoToolTipContentTemplate
DataTemplate
Gets or sets the template used to display the content of the RadSlider's tooltip.
public DataTemplate AutoToolTipContentTemplate { get; set; }
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.
public AutoToolTipPlacement AutoToolTipPlacement { get; set; }
DecreaseHandleStyle
Style
Gets or sets the style for the Decrease Repeat button used internally by the slider.
public Style DecreaseHandleStyle { get; set; }
Gets or sets the Delay property of the Increase and Decrease handles.
public int Delay { get; set; }
Each click on any of the handles increases/decreases the value by the amount that is set to the property.
Gets or sets a value indicating whether side ticks are enabled.
public bool EnableSideTicks { get; set; }
True if side ticks are enabled; otherwise, false.
HandlesVisibility
Visibility
Gets or sets the Visibility property of the Increase and Decrease handles.
public Visibility HandlesVisibility { get; set; }
Each click on any of the handles increases/decreases the value by the amount that is set to the property.
IncreaseHandleStyle
Style
Gets or sets the style for the Increase Repeat button used internally by the slider.
public Style IncreaseHandleStyle { get; set; }
Gets or sets a value that indicates whether the content is stationary when the user drags the Thumb of RadSlider. This is dependency property.
public bool IsDeferredDraggingEnabled { get; set; }
Gets or sets the direction of increasing value. This is a dependency property.
public bool IsDirectionReversed { get; set; }
The value of this property determines the direction of increasing value of a RadRadSlider.
<p>
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 <b>IsDirectionReversed</b> property is changed to true, the <xref href="System.Windows.Controls.Primitives.RangeBase.Value?text=Value" data-throw-if-not-resolved="false"></xref> of the <xref href="Telerik.Windows.Controls.RadSlider?text=RadSlider" data-throw-if-not-resolved="false"></xref> decreases as the thumb moves up.
</p>
Gets or sets whether the wheel of the mouse can be used for sliding the thumb. This is dependency property.
public bool IsMouseWheelEnabled { get; set; }
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.
public bool IsMoveToPointEnabled { get; set; }
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.
Gets or sets a value that indicates whether the RadSlider automatically moves the thumb to the closest tick mark. This is a dependency property.
public bool IsSnapToTickEnabled { get; set; }
Gets or sets a value that determines the click action of the Middle Thumb of RadSlider. This is dependency property.
public MiddleThumbClickMode MiddleThumbClickMode { get; set; }
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
Orientation
Gets or sets the orientation of a RadSlider. This is a dependency property.
public Orientation Orientation { get; set; }
Gets or sets the RepeatInterval property of the Increase and Decrease handles.
public int RepeatInterval { get; set; }
Each click on any of the handles increases/decreases the value by the amount that is set to the property.
Gets or sets the style for the border track used internally by the slider.
[Browsable(false)]
public ObservableCollection<double> ResultTicks { get; }
Gets or sets the style for the middle Thumb used internally by the slider, in case of SelectionRangeEnabled is True.
public Style SelectionMiddleThumbStyle { get; set; }
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.
public StepAction StepAction { get; set; }
Gets the collection that contains all the thumbs in the control.
public ObservableCollection<SliderThumbBase> Thumbs { get; }
ThumbStyle
Style
Gets or sets the style for the Thumbs used internally by the slider.
public Style ThumbStyle { get; set; }
ThumbToolTipStyle
Style
Gets or sets the style for the ToolTip of the Thumb used internally by the slider.
public Style ThumbToolTipStyle { get; set; }
The AutoToolTipPlacement property controls the Thumb ToolTip of the RadSlider.
ThumbVisibility
Visibility
Gets or sets the visibility of the thumb(s) in RadSlider.
public Visibility ThumbVisibility { get; set; }
TickBarStyle
Style
Gets or sets the style for the RadTickBar used internally by the slider.
public Style TickBarStyle { get; set; }
Gets or sets the interval between tick marks. This is a dependency property.
public double TickFrequency { get; set; }
Gets or sets the position of tick marks with respect to the track of the RadSlider. This is a dependency property.
public TickPlacement TickPlacement { get; set; }
Ticks
DoubleCollection
Gets or sets the positions of the tick marks to display for a RadSlider. This is a dependency property.
public DoubleCollection Ticks { get; set; }
TickTemplate
DataTemplate
Gets or sets the TickTemplate that will be used to represent a single tick on the TickBar.
public DataTemplate TickTemplate { get; set; }
TickTemplateSelector
DataTemplateSelector
Gets or sets the TickTemplateSelector that will be used to pick a template for the tick marks.
public DataTemplateSelector TickTemplateSelector { get; set; }
TrackStyle
Style
Gets or sets the style for the track used internally by the slider.
public Style TrackStyle { get; set; }
Methods
Begins the initialization process for the RadSlider control.
public override void BeginInit()
Implements:
This method should be called before setting properties that affect layout or behavior, ensuring that the control is in a state suitable for configuration.
Changes the visual state of the control.
protected virtual void ChangeVisualState()
Changes the visual state of the control.
Finalizes the initialization process of the RadSlider control.
public override void EndInit()
Implements:
This method is typically called after all of the properties have been set on the control.
When overridden in a derived class, is invoked whenever application code or internal processes (such as a rebuilding layout pass) call .
public override void OnApplyTemplate()
Overrides:
OnCreateAutomationPeer()
AutomationPeer
Creates new SliderAutomationPeer when needed.
protected override AutomationPeer OnCreateAutomationPeer()
AutomationPeer
Raises the event. This method is invoked whenever is set to true internally.
protected override void OnInitialized(EventArgs e)
The RoutedEventArgs that contains the event data.
Overrides:
Called when the is focused changes.
protected virtual void OnIsFocusedChanged()
Called when the IsSelectionRangeEnabled property changes value.
protected override void OnIsSelectionRangeEnabledChanged()
Overrides:
Handles the KeyDown event for the RadSlider control, updating the value or selection based on the pressed key.
protected override void OnKeyDown(KeyEventArgs e)
The KeyEventArgs that contains the event data.
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.
protected override void OnMouseWheel(MouseWheelEventArgs e)
The MouseWheelEventArgs that contains the event data.
Called when the Orientation property changes value.
protected virtual void OnOrientationChanged()
Resets the theme.
public void ResetTheme()
This method will take the current min, max, and value to calculate and layout the current control measurements.
protected virtual void UpdateTrackLayout()
Events
Occurs when the Thumb control loses mouse capture.
public event EventHandler<RadDragCompletedEventArgs> DragCompleted
Occurs when the mouse moves while the thumb is still on focus.
public event EventHandler<RadDragDeltaEventArgs> DragDelta
Occurs when a thumb starts dragging.
public event EventHandler<RadDragStartedEventArgs> DragStarted