Class SfSlider
Slider is a highly interactive UI control, allowing users to select a single value from a range of values. 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 SfSlider : SliderBase, IDisposable
Examples
The below examples shows, how to initialize the slider.
<slider:SfSlider Minimum="5"
Maximum="10"
Value="7" />
Constructors
SfSlider()
Initializes a new instance of the SfSlider class.
Declaration
public SfSlider()
Examples
The below examples shows, how to initialize the slider.
<slider:SfSlider Minimum="5"
Maximum="10"
Value="7" />
Fields
ValueProperty
Identifies the Value dependency property.
Declaration
public static readonly DependencyProperty ValueProperty
Field Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DependencyProperty | The identifier for Value dependency property. |
Properties
Value
Gets or sets the current value for the slider range.
Declaration
public double Value { get; set; }
Property Value
Type | Description |
---|---|
System.Double | Current value for the slider range. The default value is 0. |
Examples
<slider:SfSlider Value="50" />
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resource in SfSlider.
Declaration
public void Dispose()
Dispose(Boolean)
Disposing 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 |
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
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
ValueChanged
Event raised when the slider value is changed.
Declaration
public event EventHandler<SliderValueChangedEventArgs> ValueChanged
Event Type
Type |
---|
System.EventHandler<SliderValueChangedEventArgs> |