Install DatePicker today using XAML

I have the following DatePickercontrol in my project:

<DatePicker x:Name="startDate" SelectedDate="2013-04-03"></DatePicker>

Question:
Can I install DatePicker.SelectedDateusing only XAML?

I know that this can be achieved using code.

+5
source share
1 answer

Try it...

Add this to xaml refs:

xmlns:sys="clr-namespace:System;assembly=mscorlib"

Then write this:

<DatePicker SelectedDate="{x:Static sys:DateTime.Now}"/>
+11
source

All Articles