The CalendarWithClock control consists of a calendar and a clock, allowing the user to select the date and time with the mouse.
1 2 3 4
[TemplatePart(Name = ElementButtonConfirm, Type = typeof(Button))] [TemplatePart(Name = ElementClockPresenter, Type = typeof(ContentPresenter))] [TemplatePart(Name = ElementCalendarPresenter, Type = typeof(ContentPresenter))] publicclassCalendarWithClock : Control
Create Date Picker
1
<hc:CalendarWithClock />
1
var dateTimePicker = new CalendarWithClock();
The generated CalendarWithClock is shown below:
Select date and time
Select the date and time on the calendar and clock with the mouse, and then click the OK button to update the date and time of the CalendarWithClock control.
You can also set the date like this in a XAML clock or code.