author | Description | title | ms.assetid | isNew | label | template | ms.author | ms.date | ms.topic | ms.prod | ms.technology | keywords | pm-contact | design-contact | dev-contact | doc-status | ms.localizationpriority |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
muhsinking |
The date picker gives you a standardized way to let users pick a localized date value using touch, mouse, or keyboard input. |
Date picker |
d4a01425-4dee-4de3-9a05-3e85c3fc03cb |
true |
Date picker |
detail.hbs |
mukin |
05/19/2017 |
article |
windows |
uwp |
windows 10, uwp |
kisai |
ksulliv |
joyate |
Published |
medium |
The date picker gives you a standardized way to let users pick a localized date value using touch, mouse, or keyboard input.
Important APIs: DatePicker class, Date property
Use a date picker to let a user pick a known date, such as a date of birth, where the context of the calendar is not important.
For more info about choosing the right date control, see the Date and time controls article.
XAML Controls Gallery | |
---|---|
![]() |
If you have the XAML Controls Gallery app installed, click here to open the app and see the DatePicker in action. |
The entry point displays the chosen date, and when the user selects the entry point, a picker surface expands vertically from the middle for the user to make a selection. The date picker overlays other UI; it doesn't push other UI out of the way.
This example shows how to create a simple date picker with a header.
<DatePicker x:Name=birthDatePicker Header="Date of birth"/>
DatePicker birthDatePicker = new DatePicker();
birthDatePicker.Header = "Date of birth";
The resulting date picker looks like this:
Note For important info about date values, see DateTime and Calendar values in the Date and time controls article.
- XAML Controls Gallery sample - See all the XAML controls in an interactive format.