Class SfRangeSlider
Range Slider is a highly interactive UI control, allowing users to select a smaller range from a larger data set. The range can be selected by moving the thumb along the track. It provides rich features such as labels, ticks, dividers, thumb, and tooltip.
Implements
Inherited Members
Namespace: Syncfusion.UI.Xaml.Sliders
Assembly: Syncfusion.Sliders.WinUI.dll
Syntax
public class SfRangeSlider : SliderBase, IDisposable
Examples
The below examples shows, how to initialize the range slider.
<slider:SfRangeSlider Minimum="5"
Maximum="10"
RangeStart="6"
RangeEnd="9" />
Constructors
SfRangeSlider()
Initializes a new instance of the SfRangeSlider class.
Declaration
public SfRangeSlider()
Examples
The below examples shows, how to initialize the range slider.
<slider:SfRangeSlider Minimum="5"
Maximum="10"
RangeStart="6"
RangeEnd="9" />
Fields
CanDragActiveRangeProperty
Identifies the CanDragActiveRange dependency property.
Declaration
public static readonly DependencyProperty CanDragActiveRangeProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for CanDragActiveRange dependency property. |
RangeEndProperty
Identifies the RangeEnd dependency property.
Declaration
public static readonly DependencyProperty RangeEndProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for RangeEnd dependency property. |
RangeStartProperty
Identifies the RangeStart dependency property.
Declaration
public static readonly DependencyProperty RangeStartProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for RangeStart dependency property. |
ToolTipOptionProperty
Identifies the ToolTipOption dependency property.
Declaration
public static readonly DependencyProperty ToolTipOptionProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for ToolTipOption dependency property. |
Properties
CanDragActiveRange
Gets or sets a value indicating whether to drag on active range instead of thumbs.
Declaration
public bool CanDragActiveRange { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if range dragging is enabled; otherwise, false.The default value is false. |
Examples
<slider:SfRangeSlider RangeStart="30"
RangeEnd="70"
CanDragActiveRange="True" />
RangeEnd
Gets or sets the end limit value of the slider range.
Declaration
public double RangeEnd { get; set; }
Property Value
Type | Description |
---|---|
System.Double | End value of the slider range. The default value is 0. |
Examples
<slider:SfRangeSlider RangeStart="30"
RangeEnd="70" />
RangeStart
Gets or sets the start limit value of the slider range.
Declaration
public double RangeStart { get; set; }
Property Value
Type | Description |
---|---|
System.Double | Start value of the slider range. The default value is 0. |
Examples
<slider:SfRangeSlider RangeStart="30"
RangeEnd="70" />
ToolTipOption
Gets or sets the value to show the tooltip on both thumbs or only on the active thumb.
Declaration
public TooltipOption ToolTipOption { get; set; }
Property Value
Type | Description |
---|---|
TooltipOption | One of the enumeration values that specifies the tooltip displayed for both thumbs or only for the active thumb. The default is BothThumb. |
Examples
<slider:SfRangeSlider RangeStart="30"
RangeEnd="70"
ToolTipOption="ActiveThumb" />
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resource in SfRangeSlider.
Declaration
public void Dispose()
Dispose(Boolean)
Disposing range slider objects.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | Used to indicate perform dispose or not. |
MeasureOverride(Size)
Measures the size in layout required for child elements.
Declaration
protected override Size MeasureOverride(Size availableSize)
Parameters
Type | Name | Description |
---|---|---|
Windows.Foundation.Size | availableSize | This size give to child elements. |
Returns
Type | Description |
---|---|
Windows.Foundation.Size | Return child element size. |
OnApplyTemplate()
Invoke to render SfSlider class.
Declaration
protected override void OnApplyTemplate()
Overrides
OnCreateAutomationPeer()
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
Type |
---|
Microsoft.UI.Xaml.Automation.Peers.AutomationPeer |
OnGotFocus(RoutedEventArgs)
Called when the control got focus.
Declaration
protected override void OnGotFocus(RoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.RoutedEventArgs | e | The routed event arguments. |
OnKeyDown(KeyRoutedEventArgs)
Called when the key is pressed.
Declaration
protected override void OnKeyDown(KeyRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.KeyRoutedEventArgs | e | The key routed event arguments. |
Overrides
OnLostFocus(RoutedEventArgs)
Called when the control lost focus.
Declaration
protected override void OnLostFocus(RoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.RoutedEventArgs | e | The routed event arguments. |
Overrides
OnPointerExited(PointerRoutedEventArgs)
Called when the pointer exited.
Declaration
protected override void OnPointerExited(PointerRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.PointerRoutedEventArgs | e | Pointer routed event args |
Overrides
OnPointerMoved(PointerRoutedEventArgs)
Called when the pointer moved.
Declaration
protected override void OnPointerMoved(PointerRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.PointerRoutedEventArgs | e | Pointer routed event args |
OnPointerPressed(PointerRoutedEventArgs)
Called when the pointer pressed.
Declaration
protected override void OnPointerPressed(PointerRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.PointerRoutedEventArgs | e | Pointer routed event args |
Overrides
OnPointerReleased(PointerRoutedEventArgs)
Called when the pointer released.
Declaration
protected override void OnPointerReleased(PointerRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.PointerRoutedEventArgs | e | Pointer routed event args |
Overrides
Events
RangeValueChanged
Event raised when the range start or end values are changed.
Declaration
public event EventHandler<RangeValueChangedEventArgs> RangeValueChanged
Event Type
Type |
---|
System.EventHandler<RangeValueChangedEventArgs> |
Examples
<slider:SfRangeSlider RangeStart = "30"
RangeEnd="70"
RangeValueChanged="SfRangeSlider_RangeValueChanged" />