DatePicker

Select dates and times with compact, inline, or wheel-based native pickers.

DatePicker wraps the native date picker and exposes its value as a bindable local DateTime.

var reminder = new DatePicker
{
    Mode = DatePickerMode.DateAndTime,
    Kind = DatePickerStyle.Compact,
    Minimum = DateTime.Today,
    Maximum = DateTime.Today.AddMonths(6),
    Date = Bind(vm => vm.ScheduledFor)
        .TwoWay((vm, val) => vm.ScheduledFor = val)
};

Mode controls which components are editable:

  • Date selects a calendar date.
  • Time selects a time of day.
  • DateAndTime selects both.

Kind controls presentation. Compact expands from a small field, Inline keeps the calendar or time selector in the layout, and Wheels uses the traditional scrolling columns.

Bounds and sizing

Set Minimum and Maximum to nullable DateTime values when the surrounding workflow has real limits. Keep the model validation as the final authority as well.

The picker normally uses its native intrinsic size. Give it an explicit width only when it needs to align with neighboring controls:

new DatePicker
{
    Mode = DatePickerMode.Time,
    Kind = DatePickerStyle.Compact,
    Width = 150
};

Assign DateChanged for local view behavior, or use a two-way binding when the date is application state. Date defaults to the current local date and time.