menu

Class DateTimePickerBase - API Reference

    Show / Hide Table of Contents

    Class DateTimePickerBase

    Represents a class which is used to maintain the common codes of SfDatePicker, SfTimePicker, and SfCalendarDatePicker controls.

    Inheritance
    System.Object
    SfDropDownBase
    DateTimePickerBase
    SfCalendarDatePicker
    SfDatePicker
    SfTimePicker
    Implements
    System.IDisposable
    Inherited Members
    SfDropDownBase.ContentProperty
    SfDropDownBase.ContentTemplateProperty
    SfDropDownBase.DropDownButtonTemplateProperty
    SfDropDownBase.DropDownHeightProperty
    SfDropDownBase.DropDownModeProperty
    SfDropDownBase.DropDownPlacementProperty
    SfDropDownBase.ShowDropDownButtonProperty
    SfDropDownBase.ShowSubmitButtonsProperty
    SfDropDownBase.IsOpenProperty
    SfDropDownBase.Dispose()
    SfDropDownBase.OnPrimaryButtonClicked()
    SfDropDownBase.OnAcceptButtonClicked()
    SfDropDownBase.OnDeclineButtonClicked()
    SfDropDownBase.OpenDropDown()
    SfDropDownBase.CloseDropDown()
    SfDropDownBase.Dispose(Boolean)
    SfDropDownBase.Content
    SfDropDownBase.ContentTemplate
    SfDropDownBase.DropDownButtonTemplate
    SfDropDownBase.DropDownHeight
    SfDropDownBase.DropDownMode
    SfDropDownBase.DropDownPlacement
    SfDropDownBase.IsOpen
    SfDropDownBase.ShowDropDownButton
    SfDropDownBase.ShowSubmitButtons
    SfDropDownBase.DropDownOpened
    SfDropDownBase.DropDownClosed
    Namespace: Syncfusion.UI.Xaml.Editors
    Assembly: Syncfusion.Editors.WinUI.dll
    Syntax
    public class DateTimePickerBase : SfDropDownBase, IDisposable

    Constructors

    DateTimePickerBase()

    Initializes a new instance of the DateTimePickerBase class.

    Declaration
    public DateTimePickerBase()

    Fields

    AllowNullProperty

    Identifies AllowNull dependency property.

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

    The identifier for the AllowNull dependency property.

    DescriptionProperty

    Identifies Description dependency property.

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

    EditModeProperty

    Identifies EditMode dependency property.

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

    The identifier for the EditMode dependency property.

    HeaderProperty

    Identifies Header dependency property.

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

    HeaderTemplateProperty

    Identifies HeaderTemplate dependency property.

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

    ShowClearButtonProperty

    Identifies ShowClearButton dependency property.

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

    The identifier for the ShowClearButton dependency property.

    Properties

    AllowNull

    Gets or sets a value indicating whether the DateTimePickerBase allows null value or not.

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

    true when DateTimePickerBase allows null value input, otherwise false. The default value is true.

    Remarks

    PlaceHolderText will be shown in editor, when AllowNull is null.

    Description

    Gets or sets content that is shown below the control. The content should provide guidance about the input expected by the control.

    Declaration
    public object Description { get; set; }
    Property Value
    Type Description
    System.Object

    The default value is null.

    Examples

    Set string as description.

    <!-- String description -->
    <editor:SfTimePicker Description = "Start time" />

    Set a control as description.

    <!-- TextBlock as description -->
    <editor:SfDatePicker>
        <editor:SfDatePicker.Description>
            <TextBlock Text = "Date of birth" FontWeight="Bold"/>
        </editor:SfDatePicker.Description>
    </editor:SfDatePicker>

    EditMode

    Gets or sets a value indicating how to edit the date or time.

    Declaration
    public DateTimeEditMode EditMode { get; set; }
    Property Value
    Type Description
    DateTimeEditMode

    The default value is Mask.

    Remarks

    Date value can be edited using a text box in editor part. To disable editing set None value. To perform input validation as user types, set Mask value. To perform input validation only after editing is completed, set Normal value. Mask editing of DateTimePickerBase will be supported only for System.Globalization.GregorianCalendar.

    Header

    Gets or sets the content for the control's header.

    Declaration
    public object Header { get; set; }
    Property Value
    Type Description
    System.Object

    The default value is null.

    Examples

    Set string as Header.

    <!-- String header -->
    <editor:SfDatePicker Header = "Date of birth" />

    Set a control as Header.

    <!-- TextBlock as header -->
    <editor:SfTimePicker>
        <editor:SfTimePicker.Header>
            <TextBlock Text = "Start time" FontWeight="Bold"/>
        </editor:SfTimePicker.Header>
    </editor:SfTimePicker>

    Apply a DataTemplate as Header.

    <!-- Templated header -->
    <calendar:SfCalendarDatePicker Header = "Date of birth">
        <calendar:SfCalendarDatePicker.HeaderTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding}" FontWeight="Bold"/>
            </DataTemplate>
        </calendar:SfCalendarDatePicker.HeaderTemplate>
    </calendar:SfCalendarDatePicker>

    HeaderTemplate

    Gets or sets the DataTemplate used to display the content of the control's header.

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

    The default value is null.

    Examples

    Set string as Header.

    <!-- String header -->
    <calendar:SfCalendarDatePicker Header = "Date of birth" />

    Set a control as Header.

    <!-- TextBlock as header -->
    <editor:SfDatePicker>
        <editor:SfDatePicker.Header>
            <TextBlock Text = "Date of birth" FontWeight="Bold"/>
        </editor:SfDatePicker.Header>
    </editor:SfDatePicker>

    Apply a DataTemplate as Header.

    <!-- Templated header -->
    <editor:SfTimePicker Header = "Start time">
        <editor:SfTimePicker.HeaderTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding}" FontWeight="Bold"/>
            </DataTemplate>
        </editor:SfTimePicker.HeaderTemplate>
    </editor:SfTimePicker>

    ShowClearButton

    Gets or sets a value indicating whether to show or hide the clear button in date and time editors.

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

    The default value is true.

    Remarks

    The ShowClearButton property will not have any effect when EditMode is None.

    Methods

    AttachFlyout()

    Helps to attach the DropDownFlyout to DateTimePickerBase.

    Declaration
    protected virtual void AttachFlyout()

    OnApplyTemplate()

    Declaration
    protected override void OnApplyTemplate()
    Overrides
    SfDropDownBase.OnApplyTemplate()

    OnGotFocus(RoutedEventArgs)

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

    OnKeyDown(KeyRoutedEventArgs)

    Declaration
    protected override void OnKeyDown(KeyRoutedEventArgs e)
    Parameters
    Type Name Description
    Microsoft.UI.Xaml.Input.KeyRoutedEventArgs e
    Overrides
    SfDropDownBase.OnKeyDown(KeyRoutedEventArgs)

    OnKeyUp(KeyRoutedEventArgs)

    Declaration
    protected override void OnKeyUp(KeyRoutedEventArgs e)
    Parameters
    Type Name Description
    Microsoft.UI.Xaml.Input.KeyRoutedEventArgs e
    Overrides
    SfDropDownBase.OnKeyUp(KeyRoutedEventArgs)

    OnPointerEntered(PointerRoutedEventArgs)

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

    OnPointerExited(PointerRoutedEventArgs)

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

    OnPointerPressed(PointerRoutedEventArgs)

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

    UpdateValues()

    Helps to update Syncfusion.UI.Xaml.Editors.DateTimeHandler properties value.

    Declaration
    protected virtual void UpdateValues()

    Implements

    System.IDisposable
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved