MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class SfSlider

    Show / Hide Table of Contents

    Class SfSlider

    A material design for SfSlider.

    Inheritance
    System.Object
    SfView
    RangeView<System.Double>
    SliderBase<System.Double>
    SfSlider
    Implements
    IDrawableLayout
    Microsoft.Maui.Graphics.IDrawable
    Microsoft.Maui.IAbsoluteLayout
    Microsoft.Maui.ILayout
    Microsoft.Maui.IView
    Microsoft.Maui.IElement
    Microsoft.Maui.ITransform
    Microsoft.Maui.IContainer
    System.Collections.Generic.IList<Microsoft.Maui.IView>
    System.Collections.Generic.ICollection<Microsoft.Maui.IView>
    System.Collections.Generic.IEnumerable<Microsoft.Maui.IView>
    System.Collections.IEnumerable
    Microsoft.Maui.ISafeAreaView
    Microsoft.Maui.IPadding
    Microsoft.Maui.IVisualTreeElement
    IOrientationElement
    INumericElement
    Inherited Members
    SliderBase<Double>.OrientationProperty
    SliderBase<Double>.ValueProperty
    SliderBase<Double>.ThumbIconProperty
    SliderBase<Double>.IOrientationElement.OnOrientationChanged(SliderOrientation)
    SliderBase<Double>.Orientation
    SliderBase<Double>.Value
    SliderBase<Double>.ThumbIcon
    RangeView<Double>.MinimumProperty
    RangeView<Double>.MaximumProperty
    RangeView<Double>.IntervalProperty
    RangeView<Double>.MinorTicksPerIntervalProperty
    RangeView<Double>.ShowTicksProperty
    RangeView<Double>.ShowLabelsProperty
    RangeView<Double>.ShowDividersProperty
    RangeView<Double>.IsInversedProperty
    RangeView<Double>.TrackExtentProperty
    RangeView<Double>.LabelsPlacementProperty
    RangeView<Double>.EdgeLabelsPlacementProperty
    RangeView<Double>.EnableDeferredUpdateProperty
    RangeView<Double>.DeferredUpdateDelayProperty
    RangeView<Double>.TrackStyleProperty
    RangeView<Double>.ThumbStyleProperty
    RangeView<Double>.ThumbOverlayStyleProperty
    RangeView<Double>.DividerStyleProperty
    RangeView<Double>.MajorTickStyleProperty
    RangeView<Double>.MinorTickStyleProperty
    RangeView<Double>.LabelStyleProperty
    RangeView<Double>.TooltipProperty
    RangeView<Double>.DragStartedCommandProperty
    RangeView<Double>.DragStartedCommandParameterProperty
    RangeView<Double>.DragCompletedCommandProperty
    RangeView<Double>.DragCompletedCommandParameterProperty
    RangeView<Double>.ChangeVisualState()
    RangeView<Double>.OnBindingContextChanged()
    RangeView<Double>.OnPropertyChanged(String)
    RangeView<Double>.OnHandlerChanged()
    RangeView<Double>.MeasureContent(Double, Double)
    RangeView<Double>.ArrangeContent(Rect)
    RangeView<Double>.OnDraw(ICanvas, RectF)
    RangeView<Double>.Minimum
    RangeView<Double>.Maximum
    RangeView<Double>.Interval
    RangeView<Double>.MinorTicksPerInterval
    RangeView<Double>.ShowDividers
    RangeView<Double>.ShowTicks
    RangeView<Double>.ShowLabels
    RangeView<Double>.IsInversed
    RangeView<Double>.TrackExtent
    RangeView<Double>.LabelsPlacement
    RangeView<Double>.EdgeLabelsPlacement
    RangeView<Double>.EnableDeferredUpdate
    RangeView<Double>.DeferredUpdateDelay
    RangeView<Double>.TrackStyle
    RangeView<Double>.ThumbStyle
    RangeView<Double>.ThumbOverlayStyle
    RangeView<Double>.DividerStyle
    RangeView<Double>.MajorTickStyle
    RangeView<Double>.MinorTickStyle
    RangeView<Double>.LabelStyle
    RangeView<Double>.Tooltip
    RangeView<Double>.DragStartedCommand
    RangeView<Double>.DragStartedCommandParameter
    RangeView<Double>.DragCompletedCommand
    RangeView<Double>.DragCompletedCommandParameter
    RangeView<Double>.ValueChangeStart
    RangeView<Double>.ValueChangeEnd
    RangeView<Double>.LabelCreated
    SfView.MeasureOverride(Double, Double)
    SfView.ArrangeOverride(Rect)
    SfView.OnMeasure(Double, Double)
    SfView.IDrawableLayout.InvalidateDrawable()
    SfView.Children
    SfView.ClipToBounds
    SfView.Padding
    SfView.IDrawableLayout.DrawingOrder
    Namespace: Syncfusion.Maui.Sliders
    Assembly: Syncfusion.Maui.Sliders.dll
    Syntax
    public class SfSlider : SliderBase<double>, IDrawableLayout, IDrawable, IAbsoluteLayout, ILayout, IView, IElement, ITransform, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, ISafeAreaView, IPadding, IVisualTreeElement, ITouchListener, ITapGestureListener, IPanGestureListener, IGestureListener, IOrientationElement, IRangeView<double>, INumericElement

    Constructors

    SfSlider()

    Initializes a new instance of the SfSlider class.

    Declaration
    public SfSlider()

    Fields

    NumberFormatProperty

    The backing store for the NumberFormat field.

    Declaration
    public static readonly BindableProperty NumberFormatProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    Microsoft.Maui.Controls.BindableProperty.

    StepSizeProperty

    The backing store for the StepSize field.

    Declaration
    public static readonly BindableProperty StepSizeProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    Microsoft.Maui.Controls.BindableProperty.

    Properties

    NumberFormat

    Gets or sets the value to format the label text.

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

    Defaults to 0.##.

    Examples
    • XAML
    • C#
    <sliders:SfSlider ShowLabels = "True"
                      NumberFormat = "0.0" />
    SfSlider slider = new SfSlider()
    {
        ShowLabels = true,
        NumberFormat = "0.0",
    };

    StepSize

    Gets or sets the value indicating whether to select the discrete value.

    For example, if Minimum is 0.0 and Maximum is 10.0 and StepSize is 2.0, then the slider will move the thumb positions to 0.0, 2.0, 4.0, 6.0, 8.0 and 10.0 only.

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

    Defaults to 0d.

    Remarks

    StepSize does not work with BetweenThumbs.

    Examples

    Snippet for SfSlider

    • XAML
    • C#
    <sliders:SfSlider Minimum="0"
                      Maximum="10" 
                      StepSize="0.2">
    </sliders:SfSlider>
    SfSlider slider = new SfSlider()
    { 
         Minimum = 0,
         Maximum = 10,
         StepSize = 0.2
    };

    Events

    ValueChanged

    Represents the ValueChanged event, which occurs when the user is done selecting a new value for the slider.

    Declaration
    public event EventHandler<SliderValueChangedEventArgs> ValueChanged
    Event Type
    Type Description
    System.EventHandler<SliderValueChangedEventArgs>
    Examples
    • XAML
    • C#
    <sliders:SfSlider ValueChanged="OnValueChanged" />
    SfSlider slider = new SfSlider()
    {
        ValueChanged += OnValueChanged
    }
    
    private void OnValueChanged(object sender, SliderValueChangedEventArgs e)
    {
    }

    ValueChanging

    Represents the ValueChanging event, which occurs when the user is selecting a new value for the Slider by dragging the thumb.

    Declaration
    public event EventHandler<SliderValueChangingEventArgs> ValueChanging
    Event Type
    Type Description
    System.EventHandler<SliderValueChangingEventArgs>
    Examples
    • XAML
    • C#
    <sliders:SfSlider ValueChanging="OnValueChanging" />
    SfeSlider slider = new SfSlider()
    {
        ValueChanging += OnValueChanging
    }
    
    private void OnValueChanging(object sender, SliderValueChangingEventArgs e)
    {
    }

    Explicit Interface Implementations

    INumericElement.OnNumberFormatChanged(String, String)

    Declaration
    void INumericElement.OnNumberFormatChanged(string oldValue, string newValue)
    Parameters
    Type Name Description
    System.String oldValue
    System.String newValue

    INumericElement.OnStepChanged()

    Declaration
    void INumericElement.OnStepChanged()

    Implements

    IDrawableLayout
    Microsoft.Maui.Graphics.IDrawable
    Microsoft.Maui.IAbsoluteLayout
    Microsoft.Maui.ILayout
    Microsoft.Maui.IView
    Microsoft.Maui.IElement
    Microsoft.Maui.ITransform
    Microsoft.Maui.IContainer
    System.Collections.Generic.IList<>
    System.Collections.Generic.ICollection<>
    System.Collections.Generic.IEnumerable<>
    System.Collections.IEnumerable
    Microsoft.Maui.ISafeAreaView
    Microsoft.Maui.IPadding
    Microsoft.Maui.IVisualTreeElement
    IOrientationElement
    INumericElement
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved