Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DateTimePicker wpf toolkit binding

How to bind the Selected DateTime in WPF Toolkit's or extended Toolkit's DateTimePicker as I do not find a SelectedDateTime property?

I guesses I might need to bind it with the 'Value' property but I am not sure. No documentation is available.

I am using MVVM.

like image 930
Shakti Prakash Singh Avatar asked May 16 '12 19:05

Shakti Prakash Singh


1 Answers

For DatePicker it's SelectedDate property, and for DateTimePicker it's Value since there's no other property with type DateTime.

<DatePicker SelectedDate="{Binding MyDate}" />

<xctk:DateTimePicker Value="{Binding MyDate}"></xctk:DateTimePicker>

And if you are using .Net 4, there's already a build-in DatePicker, so no need for the Toolkit, there isn't a DateTimePicker though.

like image 106
shriek Avatar answered Nov 15 '22 12:11

shriek