Fabulous API
Documentation
2.0
2.0
  • Welcome
  • Xamarin.Forms
    • AnyView
    • Application
    • Element
    • NavigableElement
    • VisualElement
    • View
    • Controls
      • ActivityIndicator
      • BoxView
      • Button
      • CheckBox
      • DatePicker
      • Editor
      • Entry
      • FormattedLabel
      • ImageButton
      • Image
      • IndicatorView
      • InputView
      • Label
      • Picker
      • ProgressBar
      • RadioButton
      • SearchBar
      • Slider
      • Span
      • Stepper
      • Switch
      • TimePicker
      • WebView
    • Collections
      • CarouselView
      • CollectionView
      • ItemsView
      • ListView
    • Layouts
      • Layout
      • TemplatedView
  • .NET MAUI
    • AnyView
    • Application
    • Element
    • NavigableElement
    • VisualElement
    • View
    • Controls
      • ActivityIndicator
      • BoxView
      • Button
      • CheckBox
      • DatePicker
      • Editor
      • Entry
      • FormattedLabel
      • ImageButton
      • Image
      • IndicatorView
      • InputView
      • Label
      • Picker
      • ProgressBar
      • RadioButton
      • SearchBar
      • Slider
      • Span
      • Stepper
      • Switch
      • TimePicker
      • WebView
    • Collections
      • CarouselView
      • CollectionView
      • ItemsView
      • ListView
    • Layouts
      • Layout
      • TemplatedView
  • Avalonia
    • AnyView
    • Application
    • RenderOptions
    • Animatable
    • StyledElement
    • Transform
    • Visual
    • Layoutable
    • InputElement
    • DragDrop
    • FlyoutBase
    • PopupFlyoutBase
    • Control
    • Decorator
    • TemplatedControl
    • ContentControl
    • Spinner
    • TopLevel
    • TextElement
    • ItemsControl
    • SelectingItemsControl
    • MenuBase
    • WindowBase
    • Styling
      • KeyFrame
      • Animation
      • Transition
      • Style
    • Media
      • Transforms
        • Transform
        • MatrixTransform
        • SkewTransform
        • RotateTransform
        • TranslateTransform
        • ScaleTransform
        • Rotate3DTransform
        • TransformGroup
      • Brushes
        • Brush
        • TileBrush
        • SolidColorBrush
        • VisualBrush
        • ImageBrush
        • DrawingBrush
        • GradientStop
        • GradientBrush
        • ConicGradientBrush
        • LinearGradientBrush
        • RadialGradientBrush
      • PathSegments
        • PathSegment
        • ArcSegment
        • BezierSegment
        • PolyLineSegment
        • QuadraticBezierSegment
        • PathFigure
      • Geometries
        • Geometry
        • LineGeometry
        • EllipseGeometry
        • RectangleGeometry
        • PolylineGeometry
        • PathGeometry
        • CombinedGeometry
        • GeometryGroup
      • DashStyle
      • Pen
      • Drawing
      • Effects
Powered by GitBook
On this page
  • Constructors
  • Properties
  • Events
  • Usages
Edit on GitHub
  1. .NET MAUI
  2. Controls

Slider

PreviousSearchBarNextSpan

Last updated 1 year ago

Inheritance: -> -> -> Xamarin.Forms documentation: Slider /

For details on how the control actually works, please refer to the .

Constructors

Constructors
Description

Slider(min: float, max: float, value: float, onValueChanged: float -> ‘msg)

Define a Slider widget with the min-max bounds and the current value

Properties

Properties
Description

maximumTrackColor(light: FabColor, ?dark: FabColor)

Sets the color of the maximum track depending if light or dark mode

minimumTrackColor(light: FabColor, ?dark: FabColor)

Sets the color of the minimum track depending if light or dark mode

thumbColor(light: FabColor, ?dark: FabColor)

Sets the color of the thumb

thumbImage(light: ImageSource, ?dark: ImageSource)

Sets the image of the thumb using ImageSource depending if light or dark mode

thumbImage(light: string, ?dark: string)

Sets the image of the thumb using a path depending if light or dark mode

thumbImage(light: Uri, ?dark: Uri)

Sets the image of the thumb using a URI depending if light or dark mode

thumbImage(light: Stream, ?dark: Stream)

Sets the image of the thumb using Stream depending if light or dark mode

reference(value: ViewRef<Slider>)

Sets a ViewRef instance to retrieve the Xamarin.Forms.Slider instance associated to this widget

Events

Properties
Description

onDragCompleted(onDragCompleted: ‘msg)

Sets the event handler for the drag completed event

onDragStarted(onDragStarted: ‘msg)

Sets the event handler for the drag start event

Usages

Slider(20., 80., model.Value, ValueChangedMsg)
    .maximumTrackColor(Color.Red.ToFabColor(), dark = Color.Blue.ToString()) 
    .minimumTrackColor(Color.Red.ToFabColor(), dark = Color.Blue.ToString())  
    .thumbColor(Color.Red.ToFabColor(), dark = Color.Blue.ToString())  
    .thumbImage("thumb-light.png", dark = "thumb-dark.png")
    .onDragCompleted(DragCompletedMsg) 
    .onDragStarted(DragStartedMsg) 

Get access to the underlying Xamarin.Forms.Slider

let sliderRef = ViewRef<Slider>()

Slider(20., 80., model.Value, ValueChangedMsg)
    .reference(sliderRef) 
Element
NavigableElement
VisualElement
View
API
Guide
Xamarin.Forms documentation