Introduction
DatePicker represents a control that allows a user to pick a date value.
Step 1
Open a blank app and add DatePicker and Textblock control either from the toolbox or by copying the following XAML code into your grid.
- <TextBlock Text=" Time Picker " FontSize="20">
- </TextBlock>
- <StackPanel Margin="20,30,0,0">
- <TimePicker Name="myTime" Header="Select a time" ClockIdentifier="12HourClock" TimeChanged="myTime_TimeChanged" Margin="15,0,0,0">
- </TimePicker>
- <TextBlock x:Name="selectedTime" Margin="15,15,0,0" Foreground="Green" />
- </StackPanel>
The Header defines a small text above the DatePicker control.

Step 2
If you want to show the day of the week along with the date you can add the following code to the DatePicker XAML code.
- DayFormat="{}{day.integer} {dayofweek.full}"

Step 3
Copy and paste the following code to the myDate_DateChanged event on the cs page.
- DateTimeFormatter dtf = new DateTimeFormatter("shortdate");
- selectedDate.Text = "The selected date is " + dtf.Format(e.NewDate).ToString();
Step 4
Run your application and select a date. It will be shown in our TextBlock assigned.
Step 5
If you want to assign a Minimum and a Maximum
year for the calendar you can also add the following code to the class.
- this.myDate.MinYear = new DateTimeOffset(new DateTime(1990, 1, 1));
- this.myDate.MaxYear = new DateTimeOffset(new DateTime(2016, 12, 1));
Summary
In this article, we learned about DatePicker Control For Windows 10.


Kuppurasu NagarajTOP 100Posted Feb 11, 2016, 7:39 AM EST
Nice Ramees..
Nilesh JadavPosted Oct 30, 2015, 7:55 AM EDT
Nice pace on win 10 ! Good one !
RameesPosted Oct 30, 2015, 5:35 AM EDT
Thanks :)
Mukesh KumarPosted Oct 29, 2015, 10:13 PM EDT
Good One
Harshad PansuriyaPosted Oct 29, 2015, 9:37 PM EDT
Nice one
Sibeesh VenuTOP 100Posted Oct 29, 2015, 8:41 PM EDT
Nice Share