menu

WinUI

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class SliderBase - WinUI API Reference | Syncfusion

    Show / Hide Table of Contents

    Class SliderBase

    Base class of SfSlider and SfRangeSlider. It contains common logic of track, ticks, labels, etc that help to visualize the data.

    Inheritance
    System.Object
    SliderBase
    SfRangeSlider
    SfSlider
    Namespace: Syncfusion.UI.Xaml.Sliders
    Assembly: Syncfusion.Sliders.WinUI.dll
    Syntax
    public abstract class SliderBase : Control

    Constructors

    SliderBase()

    Initializes a new instance of the SliderBase class.

    Declaration
    public SliderBase()

    Fields

    ActiveDividerTemplateProperty

    Identifies the ActiveDividerTemplate dependency property.

    Declaration
    public static readonly DependencyProperty ActiveDividerTemplateProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for ActiveDividerTemplate dependency property.

    ActiveLabelTemplateProperty

    Identifies the ActiveLabelTemplate dependency property.

    Declaration
    public static readonly DependencyProperty ActiveLabelTemplateProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for ActiveLabelTemplate dependency property.

    ActiveMajorTickStyleProperty

    Identifies the ActiveMajorTickStyle dependency property.

    Declaration
    public static readonly DependencyProperty ActiveMajorTickStyleProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for ActiveMajorTickStyle dependency property.

    ActiveMinorTickStyleProperty

    Identifies the ActiveMinorTickStyle dependency property.

    Declaration
    public static readonly DependencyProperty ActiveMinorTickStyleProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for ActiveMinorTickStyle dependency property.

    ActiveTrackFillProperty

    Identifies the ActiveTrackFill dependency property.

    Declaration
    public static readonly DependencyProperty ActiveTrackFillProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for ActiveTrackFill dependency property.

    ActiveTrackHeightProperty

    Identifies the ActiveTrackHeight dependency property.

    Declaration
    public static readonly DependencyProperty ActiveTrackHeightProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for ActiveTrackHeight dependency property.

    ActiveTrackStyleProperty

    Identifies the ActiveTrackStyle dependency property.

    Declaration
    public static readonly DependencyProperty ActiveTrackStyleProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for ActiveTrackStyle dependency property.

    DisabledBrushProperty

    Identifies the DisabledBrush dependency property.

    Declaration
    public static readonly DependencyProperty DisabledBrushProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for DisabledBrush dependency property.

    DividerFillProperty

    Identifies the DividerFill dependency property.

    Declaration
    public static readonly DependencyProperty DividerFillProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for DividerFill dependency property.

    DividerHeightProperty

    Identifies the DividerHeight dependency property.

    Declaration
    public static readonly DependencyProperty DividerHeightProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for DividerHeight dependency property.

    DividerStrokeProperty

    Identifies the DividerStroke dependency property.

    Declaration
    public static readonly DependencyProperty DividerStrokeProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for DividerStroke dependency property.

    DividerStrokeThicknessProperty

    Identifies the DividerStrokeThickness dependency property.

    Declaration
    public static readonly DependencyProperty DividerStrokeThicknessProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for DividerStrokeThickness dependency property.

    DividerTemplateProperty

    Identifies the DividerTemplate dependency property.

    Declaration
    public static readonly DependencyProperty DividerTemplateProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for DividerTemplate dependency property.

    DividerWidthProperty

    Identifies the DividerWidth dependency property.

    Declaration
    public static readonly DependencyProperty DividerWidthProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for DividerWidth dependency property.

    InactiveTrackFillProperty

    Identifies the InactiveTrackFill dependency property.

    Declaration
    public static readonly DependencyProperty InactiveTrackFillProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for InactiveTrackFill dependency property.

    InactiveTrackHeightProperty

    Identifies the InactiveTrackHeight dependency property.

    Declaration
    public static readonly DependencyProperty InactiveTrackHeightProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for InactiveTrackHeight dependency property.

    InactiveTrackStyleProperty

    Identifies the InactiveTrackStyle dependency property.

    Declaration
    public static readonly DependencyProperty InactiveTrackStyleProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for InactiveTrackStyle dependency property.

    IntervalProperty

    Identifies the Interval dependency property.

    Declaration
    public static readonly DependencyProperty IntervalProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for Interval dependency property.

    IsInversedProperty

    Identifies the IsInversed dependency property.

    Declaration
    public static readonly DependencyProperty IsInversedProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for IsInversed dependency property.

    LabelOffsetProperty

    Identifies the LabelOffset dependency property.

    Declaration
    public static readonly DependencyProperty LabelOffsetProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for LabelOffset dependency property.

    LabelPlacementProperty

    Identifies the LabelPlacement dependency property.

    Declaration
    public static readonly DependencyProperty LabelPlacementProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for LabelPlacement dependency property.

    LabelTemplateProperty

    Identifies the LabelTemplate dependency property.

    Declaration
    public static readonly DependencyProperty LabelTemplateProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for LabelTemplate dependency property.

    MajorTickLengthProperty

    Identifies the MajorTickLength dependency property.

    Declaration
    public static readonly DependencyProperty MajorTickLengthProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for MajorTickLength dependency property.

    MajorTickStyleProperty

    Identifies the MajorTickStyle dependency property.

    Declaration
    public static readonly DependencyProperty MajorTickStyleProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for MajorTickStyle dependency property.

    MaximumLabelsCountProperty

    Identifies the MaximumLabelsCount dependency property.

    Declaration
    public static readonly DependencyProperty MaximumLabelsCountProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for MaximumLabelsCount dependency property.

    MaximumProperty

    Identifies the Maximum dependency property.

    Declaration
    public static readonly DependencyProperty MaximumProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for Maximum dependency property.

    MinimumProperty

    Identifies the Minimum dependency property.

    Declaration
    public static readonly DependencyProperty MinimumProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for Minimum dependency property.

    MinorTickLengthProperty

    Identifies the MinorTickLength dependency property.

    Declaration
    public static readonly DependencyProperty MinorTickLengthProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for MinorTickLength dependency property.

    MinorTicksPerIntervalProperty

    Identifies the MinorTicksPerInterval dependency property.

    Declaration
    public static readonly DependencyProperty MinorTicksPerIntervalProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for MinorTicksPerInterval dependency property.

    MinorTickStyleProperty

    Identifies the MinorTickStyle dependency property.

    Declaration
    public static readonly DependencyProperty MinorTickStyleProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for MinorTickStyle dependency property.

    OrientationProperty

    Identifies the Orientation dependency property.

    Declaration
    public static readonly DependencyProperty OrientationProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for Orientation dependency property.

    ShowDividersProperty

    Identifies the ShowDividers dependency property.

    Declaration
    public static readonly DependencyProperty ShowDividersProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for ShowDividers dependency property.

    ShowLabelsProperty

    Identifies the ShowLabels dependency property.

    Declaration
    public static readonly DependencyProperty ShowLabelsProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for ShowLabels dependency property.

    ShowTicksProperty

    Identifies the ShowTicks dependency property.

    Declaration
    public static readonly DependencyProperty ShowTicksProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for ShowTicks dependency property.

    ShowToolTipProperty

    Identifies the ShowToolTip dependency property.

    Declaration
    public static readonly DependencyProperty ShowToolTipProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for ShowToolTip dependency property.

    StepFrequencyProperty

    Identifies the StepFrequency dependency property.

    Declaration
    public static readonly DependencyProperty StepFrequencyProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for StepFrequency dependency property.

    ThumbBackgroundProperty

    Identifies the ThumbBackground dependency property.

    Declaration
    public static readonly DependencyProperty ThumbBackgroundProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for ThumbBackground dependency property.

    ThumbHeightProperty

    Identifies the ThumbHeight dependency property.

    Declaration
    public static readonly DependencyProperty ThumbHeightProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for ThumbHeight dependency property.

    ThumbOverlayFillProperty

    Identifies the ThumbOverlayFill dependency property.

    Declaration
    public static readonly DependencyProperty ThumbOverlayFillProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for ThumbOverlayFill dependency property.

    ThumbOverlayRadiusProperty

    Identifies the ThumbOverlayRadius dependency property.

    Declaration
    public static readonly DependencyProperty ThumbOverlayRadiusProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for ThumbOverlayRadius dependency property.

    ThumbStyleProperty

    Identifies the ThumbStyle dependency property.

    Declaration
    public static readonly DependencyProperty ThumbStyleProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for ThumbStyle dependency property.

    ThumbTypeProperty

    Identifies the ThumbType dependency property.

    Declaration
    public static readonly DependencyProperty ThumbTypeProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for ThumbType dependency property.

    ThumbWidthProperty

    Identifies the ThumbWidth dependency property.

    Declaration
    public static readonly DependencyProperty ThumbWidthProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for ThumbWidth dependency property.

    TickOffsetProperty

    Identifies the TickOffset dependency property.

    Declaration
    public static readonly DependencyProperty TickOffsetProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for TickOffset dependency property.

    TickPlacementProperty

    Identifies the TickPlacement dependency property.

    Declaration
    public static readonly DependencyProperty TickPlacementProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for TickPlacement dependency property.

    ToolTipFormatProperty

    Identifies the ToolTipFormat dependency property.

    Declaration
    public static readonly DependencyProperty ToolTipFormatProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for ToolTipFormat dependency property.

    ToolTipStyleProperty

    Identifies the ToolTipStyle dependency property.

    Declaration
    public static readonly DependencyProperty ToolTipStyleProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for ToolTipStyle dependency property.

    ToolTipTemplateProperty

    Identifies the ToolTipTemplate dependency property.

    Declaration
    public static readonly DependencyProperty ToolTipTemplateProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for ToolTipTemplate dependency property.

    Properties

    ActiveDividerTemplate

    Gets or sets the data template to customize the visual representation of active dividers displayed in the slider.

    Declaration
    public DataTemplate ActiveDividerTemplate { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.DataTemplate

    The template for the active dividers. The default is null.

    Remarks

    SliderBase is the DataContext for ActiveDividerTemplate.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ShowDividers="True"
                     DividerHeight="10"
                     DividerWidth="5">
        <slider:SfSlider.ActiveDividerTemplate>
            <DataTemplate>
                <Rectangle Height="{Binding DividerHeight}"
                           Width="{Binding DividerWidth}"
                           Fill="#ff003a" />
            </DataTemplate>
        </slider:SfSlider.ActiveDividerTemplate>
    
        <slider:SfSlider.DividerTemplate>
            <DataTemplate>
                <Rectangle Height="{Binding DividerHeight}"
                           Width="{Binding DividerWidth}"
                           Fill="#e30033"
                           Stroke="{Binding DividerStroke}"
                           StrokeThickness="{Binding DividerStrokeThickness}" />
            </DataTemplate>
        </slider:SfSlider.DividerTemplate>
    </slider:SfSlider>

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ShowDividers="True"
                          DividerHeight="10"
                          DividerWidth="5">
        <slider:SfRangeSlider.ActiveDividerTemplate>
            <DataTemplate>
                <Rectangle Height="{Binding DividerHeight}"
                           Width="{Binding DividerWidth}"
                           Fill="#ff003a" />
            </DataTemplate>
        </slider:SfRangeSlider.ActiveDividerTemplate>
    
        <slider:SfRangeSlider.DividerTemplate>
            <DataTemplate>
                <Rectangle Height="{Binding DividerHeight}"
                           Width="{Binding DividerWidth}"
                           Fill="#e30033"
                           Stroke="{Binding DividerStroke}"
                           StrokeThickness="{Binding DividerStrokeThickness}" />
            </DataTemplate>
        </slider:SfRangeSlider.DividerTemplate>
    </slider:SfRangeSlider>

    ActiveLabelTemplate

    Gets or sets the data template to customize the visual representation of active labels displayed in the slider.

    Declaration
    public DataTemplate ActiveLabelTemplate { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.DataTemplate

    The template for the active axis labels. The default is null.

    Remarks

    SliderLabelInfo is the DataContext for ActiveLabelTemplate.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ShowLabels="True">
        <slider:SfSlider.ActiveLabelTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding Text}"
                           Foreground="{ThemeResource SystemAccentColor}" />
            </DataTemplate>
        </slider:SfSlider.ActiveLabelTemplate>
    </slider:SfSlider>

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ShowLabels="True">
        <slider:SfRangeSlider.ActiveLabelTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding Text}"
                           Foreground="{ThemeResource SystemAccentColor}" />
            </DataTemplate>
        </slider:SfRangeSlider.ActiveLabelTemplate>
    </slider:SfRangeSlider>

    ActiveMajorTickStyle

    Gets or sets the style applied to the active major tick lines in the slider. To define a Style for the tick lines, specify a TargetType of Microsoft.UI.Xaml.Shapes.Line

    Declaration
    public Style ActiveMajorTickStyle { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.Style

    The style that is applied to active major tick line.

    Remarks

    Its Microsoft.UI.Xaml.Style.TargetType is Microsoft.UI.Xaml.Shapes.Line.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ShowTicks="True">
        <slider:SfSlider.ActiveMajorTickStyle>
            <Style TargetType="Line" >
                <Setter Property="Stroke"
                        Value="{ThemeResource SystemAccentColor}" />
                <Setter Property="StrokeThickness"
                        Value="2" />
            </Style>
        </slider:SfSlider.ActiveMajorTickStyle>
    </slider:SfSlider>

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ShowTicks="True" >
        <slider:SfRangeSlider.ActiveMajorTickStyle>
            <Style TargetType="Line" >
                <Setter Property="Stroke"
                        Value="{ThemeResource SystemAccentColor}" />
                <Setter Property="StrokeThickness"
                        Value="2" />
            </Style>
        </slider:SfRangeSlider.ActiveMajorTickStyle>
    </slider:SfRangeSlider>

    ActiveMinorTickStyle

    Gets or sets the style applied to the active minor tick lines in the slider. To define a Style for the tick lines, specify a TargetType of Microsoft.UI.Xaml.Shapes.Line

    Declaration
    public Style ActiveMinorTickStyle { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.Style

    The style that is applied to active minor tick line.

    Remarks

    Its Microsoft.UI.Xaml.Style.TargetType is Microsoft.UI.Xaml.Shapes.Line.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ShowTicks="True">
        <slider:SfSlider.ActiveMinorTickStyle>
            <Style TargetType="Line" >
                <Setter Property="Stroke"
                        Value="{ThemeResource SystemAccentColor}" />
            </Style>
        </slider:SfSlider.ActiveMinorTickStyle>
    </slider:SfSlider>

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ShowTicks="True" >
        <slider:SfRangeSlider.ActiveMinorTickStyle>
            <Style TargetType="Line" >
                <Setter Property="Stroke"
                        Value="{ThemeResource SystemAccentColor}" />
            </Style>
        </slider:SfRangeSlider.ActiveMinorTickStyle>
    </slider:SfRangeSlider>

    ActiveTrackFill

    Gets or sets the fill color for the active track of the slider.

    Declaration
    public Brush ActiveTrackFill { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.Media.Brush

    A Brush that specifies how the active track is painted.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ActiveTrackFill="#ff003a" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ActiveTrackFill="#ff003a" />

    ActiveTrackHeight

    Gets or sets the height value for the active track part.

    Declaration
    public double ActiveTrackHeight { get; set; }
    Property Value
    Type Description
    System.Double

    The height of the active track. The default height is 2 pixels.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ActiveTrackHeight="10" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ActiveTrackHeight="10" />

    ActiveTrackStyle

    Gets or sets the style applied to the active track in the slider. To define a Style for a track, specify a TargetType of Microsoft.UI.Xaml.Shapes.Rectangle

    Declaration
    public Style ActiveTrackStyle { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.Style

    The default style applied to the active track in the Slider.

    Remarks

    Its Microsoft.UI.Xaml.Style.TargetType is Microsoft.UI.Xaml.Shapes.Rectangle.

    Examples

    Snippet for SfSlider

    <slider:SfSlider Value="50"
                     ActiveTrackHeight="10">
        <slider:SfSlider.ActiveTrackStyle>
            <Style TargetType="Rectangle">
                <Setter Property="RadiusX"
                        Value="5" />
                <Setter Property="RadiusY"
                        Value="5" />
            </Style>
        </slider:SfSlider.ActiveTrackStyle>
    </slider:SfSlider>

    Snippet for SfRangeSlider

    <slider:SfRangeSlider RangeStart="30"
                          RangeEnd="70"
                          ActiveTrackHeight="10">
        <slider:SfRangeSlider.ActiveTrackStyle>
            <Style TargetType="Rectangle">
                <Setter Property="RadiusX"
                        Value="5" />
                <Setter Property="RadiusY"
                        Value="5" />
            </Style>
        </slider:SfRangeSlider.ActiveTrackStyle>        
    </slider:SfRangeSlider>

    DisabledBrush

    Gets or sets the brush applied to the labels, tick lines and dividers when sliders is disabled.

    Declaration
    public Brush DisabledBrush { get; set; }
    Property Value
    Type
    Microsoft.UI.Xaml.Media.Brush

    DividerFill

    Gets or sets the fill color for the divider on the slider.

    Declaration
    public Brush DividerFill { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.Media.Brush

    A Brush that specifies how the divider is painted.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ShowDividers="True"
                     DividerFill="#FF5722" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ShowDividers="True"
                          DividerFill="#FF5722" />

    DividerHeight

    Gets or sets the height for the divider.

    Declaration
    public double DividerHeight { get; set; }
    Property Value
    Type Description
    System.Double

    The height of the divider. The default value is 2.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ShowDividers="True"
                     DividerHeight="10"
                     DividerWidth="10"/>

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ShowDividers="True"
                          DividerHeight="10"
                          DividerWidth="10" />

    DividerStroke

    Gets or sets the stroke color for the divider on the slider.

    Declaration
    public Brush DividerStroke { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.Media.Brush

    A Brush that specifies how the divider border is painted.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ShowDividers="True"
                     DividerFill="#F6F6F6"
                     DividerStroke="#FF5722"
                     DividerStrokeThickness="2" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ShowDividers="True"
                          DividerFill="#F6F6F6"
                          DividerStroke="#FF5722"
                          DividerStrokeThickness="2" />

    DividerStrokeThickness

    Gets or sets the width of the divider stroke outline.

    Declaration
    public double DividerStrokeThickness { get; set; }
    Property Value
    Type Description
    System.Double

    The width of the divider stroke outline. The default value is 0.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ShowDividers="True"
                     DividerFill="#F6F6F6"
                     DividerStroke="#FF5722"
                     DividerStrokeThickness="2" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ShowDividers="True"
                          DividerFill="#F6F6F6"
                          DividerStroke="#FF5722"
                          DividerStrokeThickness="2" />

    DividerTemplate

    Gets or sets the data template to customize the visual representation of dividers displayed in the slider.

    Declaration
    public DataTemplate DividerTemplate { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.DataTemplate

    The template for the dividers. The default is null.

    Remarks

    SliderBase is the DataContext for DividerTemplate.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ShowDividers="True"
                     DividerFill="#F6F6F6"
                     DividerStroke="#FF5722"
                     DividerStrokeThickness="2">
        <slider:SfSlider.DividerTemplate>
            <DataTemplate>
                <Rectangle Height="{Binding DividerHeight}"
                           Width="{Binding DividerWidth}"
                           Fill="{Binding DividerFill}"
                           Stroke="{Binding DividerStroke}"
                           StrokeThickness="{Binding DividerStrokeThickness}" />
            </DataTemplate>
        </slider:SfSlider.DividerTemplate>
    </slider:SfSlider>

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ShowDividers="True"
                          DividerFill="#F6F6F6"
                          DividerStroke="#FF5722"
                          DividerStrokeThickness="2">
        <slider:SfRangeSlider.DividerTemplate>
            <DataTemplate>
                <Rectangle Height="{Binding DividerHeight}"
                           Width="{Binding DividerWidth}"
                           Fill="{Binding DividerFill}"
                           Stroke="{Binding DividerStroke}"
                           StrokeThickness="{Binding DividerStrokeThickness}" />
            </DataTemplate>
        </slider:SfRangeSlider.DividerTemplate>
    </slider:SfRangeSlider>

    DividerWidth

    Gets or sets the width for the divider.

    Declaration
    public double DividerWidth { get; set; }
    Property Value
    Type Description
    System.Double

    The width of the divider. The default value is 2.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ShowDividers="True"
                     DividerHeight="10"
                     DividerWidth="10"/>

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ShowDividers="True"
                          DividerHeight="10"
                          DividerWidth="10" />

    InactiveTrackFill

    Gets or sets the fill color for the inactive track of the slider.

    Declaration
    public Brush InactiveTrackFill { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.Media.Brush

    A Brush that specifies how the inactive track is painted.

    Examples

    Snippet for SfSlider

    <slider:SfSlider InactiveTrackFill="#ffc6d6" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider InactiveTrackFill="#ffc6d6" />

    InactiveTrackHeight

    Gets or sets the height for the inactive track part.

    Declaration
    public double InactiveTrackHeight { get; set; }
    Property Value
    Type Description
    System.Double

    The height of the inactive track. The default height is 2.

    Examples

    Snippet for SfSlider

    <slider:SfSlider InactiveTrackHeight="5" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider InactiveTrackHeight="5" />

    InactiveTrackStyle

    Gets or sets the style applied to the inactive track in the slider. To define a Style for a track, specify a TargetType of Microsoft.UI.Xaml.Shapes.Rectangle

    Declaration
    public Style InactiveTrackStyle { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.Style

    The default style applied to the inactive track in the Slider.

    Remarks

    Its Microsoft.UI.Xaml.Style.TargetType is Microsoft.UI.Xaml.Shapes.Rectangle.

    Examples

    Snippet for SfSlider

    <slider:SfSlider Value="50"
                     InactiveTrackHeight="5">
        <slider:SfSlider.InactiveTrackStyle>
            <Style TargetType="Rectangle">
                <Setter Property="RadiusX"
                        Value="2.5" />
                <Setter Property="RadiusY"
                        Value="2.5" />
            </Style>
        </slider:SfSlider.InactiveTrackStyle>
    </slider:SfSlider>

    Snippet for SfRangeSlider

    <slider:SfRangeSlider RangeStart="30"
                          RangeEnd="70"
                          InactiveTrackHeight="5">
        <slider:SfRangeSlider.InactiveTrackStyle>
            <Style TargetType="Rectangle">
                <Setter Property="RadiusX"
                        Value="2.5" />
                <Setter Property="RadiusY"
                        Value="2.5" />
            </Style>
        </slider:SfRangeSlider.InactiveTrackStyle>        
    </slider:SfRangeSlider>

    Interval

    Gets or sets the interval value for the numerical slider. Auto-interval will be used by default. You can specify the Interval if you need to modify the default interval. It is mandatory if labels, major ticks and dividers are needed.

    Declaration
    public double Interval { get; set; }
    Property Value
    Type Description
    System.Double

    Specify the interval value for the slider. The default value is double.NaN.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ShowTicks="True"
                     Interval="10" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ShowTicks="True"
                          Interval="10" />

    IsInversed

    Gets or sets a value indicating whether to inverse the slider from right to left.

    Declaration
    public bool IsInversed { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if slider is inversed; otherwise, false.The default value is false.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ShowTicks="True"
                     ShowLabels="True"
                     IsInversed="True" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ShowTicks="True"
                          ShowLabels="True"
                          IsInversed="True" />

    LabelOffset

    Gets or sets the space between tick lines and labels.

    Declaration
    public double LabelOffset { get; set; }
    Property Value
    Type Description
    System.Double

    Specify the space between tick lines and labels. The default value is 5.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ShowLabels="True"
                     LabelOffset="15" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ShowLabels="True"
                          LabelOffset="15" />

    LabelPlacement

    Gets or sets the value that indicates whether to position the labels before or after of the track.

    Declaration
    public Placement LabelPlacement { get; set; }
    Property Value
    Type Description
    Placement

    One of the enumeration values that specifies the position of ticks in the linear gauge. The default is After.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ShowLabels="True"
                     LabelPlacement="Before" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ShowLabels="True"
                          LabelPlacement="Before" />

    LabelTemplate

    Gets or sets the data template to customize the visual representation of labels displayed in the slider.

    Declaration
    public DataTemplate LabelTemplate { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.DataTemplate

    The template for the axis labels. The default is null.

    Remarks

    SliderLabelInfo is the DataContext for LabelTemplate.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ShowLabels="True"
                     LabelOffset="15">
        <slider:SfSlider.LabelTemplate>
            <DataTemplate>
                <Grid CornerRadius="5"
                      Background="{ThemeResource SystemBaseLowColor}">
                    <TextBlock Text="{Binding Text}"
                               Margin="6" />
                </Grid>
            </DataTemplate>
        </slider:SfSlider.LabelTemplate>
    </slider:SfSlider>

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ShowLabels="True"
                          LabelOffset="15">
        <slider:SfRangeSlider.LabelTemplate>
            <DataTemplate>
                <Grid CornerRadius="5"
                      Background="{ThemeResource SystemBaseLowColor}">
                    <TextBlock Text="{Binding Text}"
                               Margin="6" />
                </Grid>
            </DataTemplate>
        </slider:SfRangeSlider.LabelTemplate>
    </slider:SfRangeSlider>

    MajorTickLength

    Gets or sets the length of the major tick line.

    Declaration
    public double MajorTickLength { get; set; }
    Property Value
    Type Description
    System.Double

    The length of the major tick line. The default value is 10.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ShowTicks="True"
                     MajorTickLength="15" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ShowTicks="True" 
                          MajorTickLength="15" />

    MajorTickStyle

    Gets or sets the style applied to the major tick lines in the slider. To define a Style for the tick lines, specify a TargetType of Microsoft.UI.Xaml.Shapes.Line

    Declaration
    public Style MajorTickStyle { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.Style

    The style that is applied to major tick line.

    Remarks

    Its Microsoft.UI.Xaml.Style.TargetType is Microsoft.UI.Xaml.Shapes.Line.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ShowTicks="True">
        <slider:SfSlider.MajorTickStyle>
            <Style TargetType="Line">
                <Setter Property="Stroke"
                        Value="Red" />
                <Setter Property="StrokeThickness"
                        Value="2" />
                <Setter Property="StrokeDashArray"
                        Value="1,1" />
            </Style>
        </slider:SfSlider.MajorTickStyle>
    </slider:SfSlider>

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ShowTicks="True" >
        <slider:SfRangeSlider.MajorTickStyle>
            <Style TargetType="Line">
                <Setter Property="Stroke"
                        Value="Red" />
                <Setter Property="StrokeThickness"
                        Value="2" />
                <Setter Property="StrokeDashArray"
                        Value="1,1" />
            </Style>
        </slider:SfRangeSlider.MajorTickStyle>
    </slider:SfRangeSlider>

    Maximum

    Gets or sets the maximum possible value of the slider range element. The scale range ends at this value.

    Declaration
    public double Maximum { get; set; }
    Property Value
    Type Description
    System.Double

    The highest possible value of the range element. The default is 100.

    Examples

    Snippet for SfSlider

    <slider:SfSlider Maximum="10" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider Maximum="10" />

    MaximumLabelsCount

    Gets or sets the maximum number of labels to be displayed in a track in 100 logical pixels.

    Declaration
    public int MaximumLabelsCount { get; set; }
    Property Value
    Type Description
    System.Int32

    Maximum number of labels to be displayed in a track in 100 logical pixels. Default value is 3.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ShowLabels="True"
                     MaximumLabelsCount="1" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ShowLabels="True" 
                          MaximumLabelsCount="1" />

    Minimum

    Gets or sets the minimum possible value of the slider range element. The scale range starts from this value.

    Declaration
    public double Minimum { get; set; }
    Property Value
    Type Description
    System.Double

    The minimum possible value of the range element. The default is 0.

    Examples

    Snippet for SfSlider

    <slider:SfSlider Minimum="5" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider Minimum="5" />

    MinorTickLength

    Gets or sets the length of the minor tick line.

    Declaration
    public double MinorTickLength { get; set; }
    Property Value
    Type Description
    System.Double

    The length of the minor tick line. The default value is 5.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ShowTicks="True"
                     MinorTickLength="10" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ShowTicks="True" 
                          MinorTickLength="10" />

    MinorTicksPerInterval

    Gets or sets the count of the minors ticks in an interval.

    Declaration
    public double MinorTicksPerInterval { get; set; }
    Property Value
    Type Description
    System.Double

    The count of the minors ticks in an interval. The default value is 1.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ShowTicks="True"
                     MinorTicksPerInterval="2" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ShowTicks="True"
                          MinorTicksPerInterval="2" />

    MinorTickStyle

    Gets or sets the style applied to the minor tick lines in the slider. To define a Style for a tick line, specify a TargetType of Microsoft.UI.Xaml.Shapes.Line

    Declaration
    public Style MinorTickStyle { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.Style

    The style that is applied to minor tick line.

    Remarks

    Its Microsoft.UI.Xaml.Style.TargetType is Microsoft.UI.Xaml.Shapes.Line.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ShowTicks="True">
        <slider:SfSlider.MinorTickStyle>
            <Style TargetType="Line">
                <Setter Property="Stroke"
                        Value="Green" />
                <Setter Property="StrokeThickness"
                        Value="2" />
                <Setter Property="StrokeDashArray"
                        Value="1,1" />
            </Style>
        </slider:SfSlider.MinorTickStyle>
    </slider:SfSlider>

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ShowTicks="True" >
        <slider:SfRangeSlider.MinorTickStyle>
            <Style TargetType="Line">
                <Setter Property="Stroke"
                        Value="Green" />
                <Setter Property="StrokeThickness"
                        Value="2" />
                <Setter Property="StrokeDashArray"
                        Value="1,1" />
            </Style>
        </slider:SfRangeSlider.MinorTickStyle>
    </slider:SfRangeSlider>

    Orientation

    Gets or sets the orientation of a slider that denotes whether to show horizontal or vertical slider.

    Declaration
    public Orientation Orientation { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.Controls.Orientation

    One of the Orientation values. The default is Horizontal.

    Remarks

    Orientation decides whether the slider is rendered in horizontal or vertical direction.

    Examples

    Snippet for SfSlider

    <slider:SfSlider Orientation="Vertical" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider Orientation="Vertical" />

    ShowDividers

    Gets or sets a value indicating whether to show or hide the dividers.

    Declaration
    public bool ShowDividers { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if dividers are displayed; otherwise, false.The default value is false.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ShowDividers="True" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ShowDividers="True" />

    ShowLabels

    Gets or sets a value indicating whether to show or hide the labels.

    Declaration
    public bool ShowLabels { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if labels are displayed; otherwise, false.The default value is false.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ShowLabels="True" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ShowLabels="True" />

    ShowTicks

    Gets or sets a value indicating whether to show or hide the tick lines.

    Declaration
    public bool ShowTicks { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if ticks are displayed; otherwise, false.The default value is false.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ShowTicks="True" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ShowTicks="True" />

    ShowToolTip

    Gets or sets a value indicating whether to show or hide the thumb tooltip.

    Declaration
    public bool ShowToolTip { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if tooltips are displayed; otherwise, false.The default value is true.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ShowToolTip="False" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ShowToolTip="False" />

    StepFrequency

    Gets or sets the value to select discrete value in the slider range.

    Declaration
    public double StepFrequency { get; set; }
    Property Value
    Type Description
    System.Double

    Option to select discrete value. The default is 0.

    Remarks

    For example; if Minimum is 0.0 and Maximum is 10.0 and StepFrequency is 2.0, the slider will move the thumb at 0.0, 2.0, 4.0, 6.0, 8.0 and 10.0.

    Examples

    Snippet for SfSlider

    <slider:SfSlider StepFrequency="10" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider StepFrequency="10" />

    ThumbBackground

    Gets or sets the background color for the thumb.

    Declaration
    public Brush ThumbBackground { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.Media.Brush

    A Brush that specifies how the thumb background is painted.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ThumbBackground="#ff003a" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ThumbBackground="#ff003a" />

    ThumbHeight

    Gets or sets the height value for the thumb.

    Declaration
    public double ThumbHeight { get; set; }
    Property Value
    Type Description
    System.Double

    The height of the thumb. The default height is 22.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ThumbHeight="30" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ThumbHeight="30" />

    ThumbOverlayFill

    Gets or sets the fill color of the overlay effect for the thumb.

    Declaration
    public Brush ThumbOverlayFill { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.Media.Brush

    A Brush that specifies how the thumb overlay is painted.

    Remarks

    Overlay effects displayed with 0.3 opacity.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ThumbOverlayFill="#ff003a" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ThumbOverlayFill="#ff003a" />

    ThumbOverlayRadius

    Gets or sets the radius of overlay effect around the thumb.

    Declaration
    public double ThumbOverlayRadius { get; set; }
    Property Value
    Type Description
    System.Double

    The radius of overlay effect around the thumb. The start radius value will be considered from the end of thumb shape. The default value is 0.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ThumbHeight="25"
                     ThumbWidth="25"
                     ThumbOverlayRadius="30" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ThumbHeight="25"
                          ThumbWidth="25"
                          ThumbOverlayRadius="30" />

    ThumbStyle

    Gets or sets the style applied to the thumb(s) in the slider. To define a Style for a thumb, specify a TargetType of Microsoft.UI.Xaml.Controls.Primitives.Thumb

    Declaration
    public Style ThumbStyle { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.Style

    The style applied to thumb(s) in the Slider. The default is null.

    Remarks

    Its Microsoft.UI.Xaml.Style.TargetType is Microsoft.UI.Xaml.Controls.Primitives.Thumb. Its Microsoft.UI.Xaml.FrameworkElement.DataContext is current value of thumb.

    Examples

    Snippet for SfSlider

    <slider:SfSlider Value="50">
        <slider:SfSlider.ThumbStyle>
            <Style TargetType="Thumb">
                <Setter Property="BorderBrush"
                        Value="WhiteSmoke" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Thumb">
                            <Grid>
                                <Ellipse Height="{TemplateBinding Height}"
                                         Width="{TemplateBinding Width}"
                                         Fill="{TemplateBinding BorderBrush}"
                                         Stroke="{TemplateBinding Background}"
                                         StrokeThickness="2" />
                                <Ellipse Height="12"
                                         Width="12"
                                         Fill="{TemplateBinding Background}" />
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </slider:SfSlider.ThumbStyle>
    </slider:SfSlider>

    Snippet for SfRangeSlider

    <slider:SfRangeSlider RangeStart="30"
                          RangeEnd="70">
        <slider:SfRangeSlider.ThumbStyle>
            <Style TargetType="Thumb">
                <Setter Property="BorderBrush"
                        Value="WhiteSmoke" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Thumb">
                            <Grid>
                                <Ellipse Height="{TemplateBinding Height}"
                                         Width="{TemplateBinding Width}"
                                         Fill="{TemplateBinding BorderBrush}"
                                         Stroke="{TemplateBinding Background}"
                                         StrokeThickness="2" />
                                <Ellipse Height="12"
                                         Width="12"
                                         Fill="{TemplateBinding Background}" />
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </slider:SfRangeSlider.ThumbStyle>             
    </slider:SfRangeSlider>

    ThumbType

    Gets or sets a value that specifies the different shape types for the slider thumb.

    Declaration
    public ThumbType ThumbType { get; set; }
    Property Value
    Type Description
    ThumbType

    One of the enumeration values that specifies the thumb type of the slider. The default is Circle.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ThumbType="Rectangle" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ThumbType="Rectangle" />

    ThumbWidth

    Gets or sets the width value for the thumb.

    Declaration
    public double ThumbWidth { get; set; }
    Property Value
    Type Description
    System.Double

    The width of the thumb. The default width is 22.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ThumbWidth="30" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ThumbWidth="30" />

    TickOffset

    Gets or sets the space between track and tick lines.

    Declaration
    public double TickOffset { get; set; }
    Property Value
    Type Description
    System.Double

    Specify the space between track and tick lines. The default value is 0.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ShowTicks="True"
                     TickOffset="30" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ShowTicks="True"
                          TickOffset="30" />

    TickPlacement

    Gets or sets the value that indicates whether to position the ticks before or after of the track.

    Declaration
    public Placement TickPlacement { get; set; }
    Property Value
    Type Description
    Placement

    One of the enumeration values that specifies the position of ticks in the slider. The default is After.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ShowTicks="True"
                     TickPlacement="Before" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ShowTicks="True"
                          TickPlacement="Before" />

    ToolTipFormat

    Gets or sets a value to formats the tooltip with globalized string formats.

    Declaration
    public string ToolTipFormat { get; set; }
    Property Value
    Type Description
    System.String

    To formats the tooltip with globalized string. The default value is N2.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ShowToolTip="True"
                     Value="50"
                     ToolTipFormat="c" />

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ShowToolTip="True"
                          Value="50"
                          ToolTipFormat="c" />

    ToolTipStyle

    Gets or sets the style applied to the tooltip in the slider. To define a Style for a tooltip, specify a TargetType of SliderToolTip

    Declaration
    public Style ToolTipStyle { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.Style

    The style that is applied to tooltip. The default value is null.

    Remarks

    Its TargetType is SliderToolTip.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ShowToolTip="True"
                     Value="50">
        <slider:SfSlider.ToolTipStyle>
            <Style TargetType="slider:SliderToolTip">
                <Setter Property="Background"
                        Value="#ff8d5e" />
                <Setter Property="Foreground"
                        Value="White" />
            </Style>
        </slider:SfSlider.ToolTipStyle>
    </slider:SfSlider>

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ShowToolTip="True"
                          Value="50">
        <slider:SfRangeSlider.ToolTipStyle>
            <Style TargetType="slider:SliderToolTip">
                <Setter Property="Background"
                        Value="#ff8d5e" />
                <Setter Property="Foreground"
                        Value="White" />
            </Style>
        </slider:SfRangeSlider.ToolTipStyle>
    </slider:SfRangeSlider>

    ToolTipTemplate

    Gets or sets the data template to customize the visual representation of thumb tooltip.

    Declaration
    public DataTemplate ToolTipTemplate { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.DataTemplate

    The template for the tooltip. The default is null.

    Remarks

    SliderToolTipInfo is the DataContext for Slider's ToolTipTemplate. RangeSliderToolTipInfo is the DataContext for Range Slider's ToolTipTemplate.

    Examples

    Snippet for SfSlider

    <slider:SfSlider ShowToolTip="True"
                     Value="50">
        <slider:SfSlider.ToolTipTemplate>
            <DataTemplate>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Current Value : "
                               Margin="0,0,5,0" />
                    <TextBlock Text="{Binding ToolTipText}" />
                </StackPanel>
            </DataTemplate>
        </slider:SfSlider.ToolTipTemplate>
    </slider:SfSlider>

    Snippet for SfRangeSlider

    <slider:SfRangeSlider ShowToolTip="True"
                          Value="50">
        <slider:SfRangeSlider.ToolTipTemplate>
            <DataTemplate>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding RangeStartValue}" />
                    <TextBlock Text="-" Margin="5,0,5,0" />
                    <TextBlock Text="{Binding RangeEndValue}" />
                </StackPanel>
            </DataTemplate>
        </slider:SfRangeSlider.ToolTipTemplate>
    </slider:SfRangeSlider>

    Methods

    FactorToValue(Double)

    Converts factor to track value.

    Declaration
    public virtual double FactorToValue(double factor)
    Parameters
    Type Name Description
    System.Double factor

    The factor to convert as track value.

    Returns
    Type Description
    System.Double

    Track value of the provided factor.

    Examples

    Snippet for both SfSlider and SfRangeSlider

    • XAML
    • C#
    public override double FactorToValue(double factor)
    {
        return Math.Pow(Math.E, factor * (labelsCount - 1) * Math.Log(10));
    }

    GenerateVisibleLabels()

    Calculates the visible labels based on interval and range.

    Declaration
    public virtual List<SliderLabelInfo> GenerateVisibleLabels()
    Returns
    Type Description
    System.Collections.Generic.List<SliderLabelInfo>

    The visible label collection.

    Examples

    Snippet for SfSlider

    • XAML
    • C#
    <local:LogarithmicSlider Minimum="1"
                             Maximum="10000"
                             Value="150"
                             ShowLabels="True"
                             ActiveTrackHeight="5"
                             InactiveTrackHeight="5" />
    public class LogarithmicSlider : SfSlider
    {
        int labelsCount;
        public override List<SliderLabelInfo> GenerateVisibleLabels()
        {
            List<SliderLabelInfo> labelInfos = new List<SliderLabelInfo>();
            int minimum = (int)LogBase(this.Minimum, 10);
            int maximum = (int)LogBase(this.Maximum, 10);
            for (int i = minimum; i <= maximum; i++)
            {
                double value = Math.Floor(Math.Pow(10, i)); // logBase  value is 10
                SliderLabelInfo label = new SliderLabelInfo()
                {
                    Value = value,
                    Text = value.ToString()
                };
                labelInfos.Add(label);
            }
    
            labelsCount = labelInfos.Count;
            return labelInfos;
        }
    }
    
    private double LogBase(double value, int baseValue)
    {
        return Math.Log(value) / Math.Log(baseValue);
    }

    Snippet for SfRangeSlider

    • XAML
    • C#
    <local:LogarithmicRangeSlider Minimum="1"
                                  Maximum="10000"
                                  Value="150"
                                  ShowLabels="True"
                                  ActiveTrackHeight="5"
                                  InactiveTrackHeight="5" />
    public class LogarithmicRangeSlider : SfRangeSlider
    {
        int labelsCount;
        public override List<SliderLabelInfo> GenerateVisibleLabels()
        {
            List<SliderLabelInfo> labelInfos = new List<SliderLabelInfo>();
            int minimum = (int)LogBase(this.Minimum, 10);
            int maximum = (int)LogBase(this.Maximum, 10);
            for (int i = minimum; i <= maximum; i++)
            {
                double value = Math.Floor(Math.Pow(10, i)); // logBase  value is 10
                SliderLabelInfo label = new SliderLabelInfo()
                {
                    Value = value,
                    Text = value.ToString()
                };
                labelInfos.Add(label);
            }
    
            labelsCount = labelInfos.Count;
            return labelInfos;
        }
    }
    
    private double LogBase(double value, int baseValue)
    {
        return Math.Log(value) / Math.Log(baseValue);
    }

    OnApplyTemplate()

    Invoke to render SliderBase class.

    Declaration
    protected override void OnApplyTemplate()

    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.

    OnLostFocus(RoutedEventArgs)

    Called when the focus got lost.

    Declaration
    protected override void OnLostFocus(RoutedEventArgs e)
    Parameters
    Type Name Description
    Microsoft.UI.Xaml.RoutedEventArgs e

    The routed event arguments.

    OnPointerEntered(PointerRoutedEventArgs)

    Called when the pointer entered.

    Declaration
    protected override void OnPointerEntered(PointerRoutedEventArgs e)
    Parameters
    Type Name Description
    Microsoft.UI.Xaml.Input.PointerRoutedEventArgs e

    Pointer routed event args

    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

    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

    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

    ValueToFactor(Double)

    Converts slider value to factor.

    Declaration
    public virtual double ValueToFactor(double value)
    Parameters
    Type Name Description
    System.Double value

    The track value to convert as factor.

    Returns
    Type Description
    System.Double

    Factor of the provided track value.

    Examples

    Snippet for both SfSlider and SfRangeSlider

    • XAML
    • C#
    public override double ValueToFactor(double value)
    {
        return LogBase(value, 10) / (labelsCount - 1);
    }
    
    private double LogBase(double value, int baseValue)
    {
        return Math.Log(value) / Math.Log(baseValue);
    }

    Events

    ThumbDragCompleted

    Event raised when the thumb dragged completed.

    Declaration
    public event EventHandler<DragCompletedEventArgs> ThumbDragCompleted
    Event Type
    Type
    System.EventHandler<Microsoft.UI.Xaml.Controls.Primitives.DragCompletedEventArgs>
    Examples
    • XAML
    • C#

    This snippet shows how to hook thumb drag started event for SfSlider

    <ScrollViewer x:Name="scrollViewer">
        <slider:SfSlider Value="50"
                          ThumbDragCompleted="SfSlider_ThumbDragCompleted" />
    </ScrollViewer>

    This snippet shows how to hook thumb drag started event for SfRangeSlider

    <ScrollViewer x:Name="scrollViewer">
        <slider:SfRangeSlider RangeStart="30"
                               RangeEnd="70"
                               ThumbDragCompleted="SfRangeSlider_ThumbDragCompleted" />
    </ScrollViewer>

    Snippet for SfSlider

    private void SfSlider_ThumbDragCompleted(object sender, DragCompletedEventArgs e)
    {
        this.scrollViewer.HorizontalScrollMode = ScrollMode.Auto;
        this.scrollViewer.VerticalScrollMode = ScrollMode.Auto;
    }

    Snippet for SfRangeSlider

    private void SfRangeSlider_ThumbDragCompleted(object sender, DragCompletedEventArgs e)
    {
        this.scrollViewer.HorizontalScrollMode = ScrollMode.Auto;
        this.scrollViewer.VerticalScrollMode = ScrollMode.Auto;
    }

    ThumbDragStarted

    Event raised when the thumb dragging started.

    Declaration
    public event EventHandler<DragStartedEventArgs> ThumbDragStarted
    Event Type
    Type
    System.EventHandler<Microsoft.UI.Xaml.Controls.Primitives.DragStartedEventArgs>
    Examples
    • XAML
    • C#

    This snippet shows how to hook thumb drag started event for SfSlider

    <ScrollViewer x:Name="scrollViewer">
        <slider:SfSlider Value="50"
                          ThumbDragStarted="SfSlider_ThumbDragStarted" />
    </ScrollViewer>

    This snippet shows how to hook thumb drag started event for SfRangeSlider

    <ScrollViewer x:Name="scrollViewer">
        <slider:SfRangeSlider RangeStart="30"
                               RangeEnd="70"
                               ThumbDragStarted="SfRangeSlider_ThumbDragStarted" />
    </ScrollViewer>

    Snippet for SfSlider

    private void SfSlider_ThumbDragStarted(object sender, DragStartedEventArgs e)
    {
        this.scrollViewer.HorizontalScrollMode = ScrollMode.Disabled;
        this.scrollViewer.VerticalScrollMode = ScrollMode.Disabled;
    }

    Snippet for SfRangeSlider

    private void SfRangeSlider_ThumbDragStarted(object sender, DragStartedEventArgs e)
    {
        this.scrollViewer.HorizontalScrollMode = ScrollMode.Disabled;
        this.scrollViewer.VerticalScrollMode = ScrollMode.Disabled;
    }
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved