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
  • iOS-specific Properties
  • Usages
Edit on GitHub
  1. .NET MAUI
  2. Controls

DatePicker

PreviousCheckBoxNextEditor

Last updated 1 year ago

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

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

Constructors

Constructors
Description

DatePicker(date: DateTime, onDateSelected: DateTime -> ‘msg)

Defines a DatePicker widget with a date and onDateSelected event

Properties

Properties
Description

characterSpacing(value: float)

Sets the spacing between each character of the date picker

font(?size: float, ?namedSize: NamedSize, ?attributes: FontAttributes, ?fontFamily: string)

Sets the font family used

format(value: string)

Sets the format of the date picker

minimumDate(value: DateTime)

Sets the minimum date of the date picker

maximumDate(value: DateTime)

Sets the maximum date of the date picker

textColor(light: FabColor, ?dark: FabColor)

Sets the text color depending if light or dark mode

textTransform(value: TextTransform)

Sets the text transformation (lowercase, uppercase) to apply on the text

reference(value: ViewRef<DatePicker>)

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

iOS-specific Properties

Properties
Description

updateMode(value: iOSSpecific.UpdateMode)

Sets the update mode (Immediately or WhenFinished) of the date picker

Usages

DatePicker(DateTime.Now, DateTimeChanged)
    .characterSpacing(1.0)
    .format("dd/MM/yyyy")
    .minimumDate(DateTime.Now)
    .maximumDate(DateTime.Now.AddYears(1))
    .textColor(Color.Red.ToFabColor(), Color.Blue..ToFabColor())
    .font(namedSize = NamedSize.Large, fontFamily = "Arial", attributes = FontAttributes.Bold)
    .textTransform(TextTransform.Lowercase)

Get access to the underlying Xamarin.Forms.DatePicker

let datePickerRef = ViewRef<DatePicker>()

DatePicker(DateTime.Now, DateTimeChanged)
    .reference(datePickerRef)
Element
NavigableElement
VisualElement
View
API
Guide
Xamarin.Forms documentation