Silverlight Date Formats

I'm having some very strange date formatting issues in a Silverlight application. My local culture is tuned to the UK, but I constantly see American dates popping up everywhere. I can easily hard-code them in the UK format in certain expressions using:

<UserControl ... Language="en-GB"...>

But, as I am sure, you will all agree that this is a terrible thing.

I tried installing Lanaguage on en-GB in the main application, and this has partial success. I also tried the Justin Angels suggestion (published here: How to change the date format in a Silverlight DatePicker control? ), Again only partial success.

An example of a problem can be seen here:

http://lh3.ggpht.com/%5FL9TmtwXFtew/Sw5aVZJfG1I/AAAAAAAAGkI/6jYnsB91HjI/image%5Fthumb%5B1%5D.png http://lh3.ggpht.com/%5FL9TmtwXFtew/Sw5aVZJfG1I/AAAAAAAAGkI/6jYnsB91HjI/image%5Fthumb % 5B1% 5D.png

In a datagrid, the parent page displays formatting in the UK, while information in ChildWindow shows formatting in the US ... grrrr

Does anyone have a final solution to solve this problem throughout the application?

Thanks Mark

+3
source share
4 answers

SelectedDateFormat datepicker? , usercontrol, , ?

,

Dan

0
+1

, ? IE Tools → → .

0

. .

        Thread.CurrentThread.CurrentCulture = (CultureInfo)Thread.CurrentThread.CurrentCulture.Clone();
        Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern = dd/MM/yyyy";
0
source

Source: https://habr.com/ru/post/1723985/


All Articles