问题
WPF Toolkit, How to apply date format in C# for datepicker control?
回答1:
I found the one way to solve of my problem by using the culture
System.Globalization.CultureInfo culInfo = new System.Globalization.CultureInfo("en-us");
System.Globalization.DateTimeFormatInfo dtinfo = new System.Globalization.DateTimeFormatInfo();
dtinfo.ShortDatePattern = "dd-Mon-yyyy";
dtinfo.DateSeparator = "-";
And apply this short date pattern to date time picker.. It works
回答2:
The datepicker in WPF Toolkit allow only Short and Long formats. You can use as
datePicker.SelectedDateFormat = Microsoft.Windows.Controls.DatePickerFormat.Long;
datePicker.SelectedDateFormat = Microsoft.Windows.Controls.DatePickerFormat.Short;
回答3:
If you change format following this way. All control have DateTime will be change. I think you need create new template and create new you custom control
来源:https://stackoverflow.com/questions/1378484/wpf-toolkit-how-to-apply-date-format-in-c-sharp-for-datepicker-control