[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework

Localization of WPF bindings

Kirill

10/22/2008 4:19:00 AM

Hello,

There is a good chance that there is a better group to post this question,
but unfortunately I failed to find one. Any points in the right direction
will be greatly appreciated.

The question concerns localization of date, time and number formats in WPF
windows.
Here is what I want:
a WPF window with a text field, bound to a DateTime DependencyProperty,
formatted according to easily configurable property.

Here is what I found:
- such field is NOT formatted according to CultureInfo.CurrentCulture (which
is set at the very beginning of the application, even before any windows are
created, with Thread.Culture.CurrentCulture = ...);

- such field is NOT formatted according to CultureInfo.CurrentUICulture (set
in a similar way);

- such field is formatted according to the Language property of the window.
However, the Language property needs to be set on each window individually,
which causes a lot of headaches in my code (there are quite few windows
already).

The question:
Is there any way to force the formatting of date-, time- and numbers-bound
text fields in WPF?

Thank you for any help and ideas!

Kirill.

3 Answers

v-mazho

10/22/2008 10:40:00 AM

0

Hello,

Welcome to Microsoft Newsgroup Support Service! My name is Marco Zhou. It's
my pleasure to work with you on this thread.

In WPF, the Language property of FrameworkElement will default to US
English, in order to override it with the current language setting, you
could try overriding the FrameworkElement.Language property's property
metadata as demonstrated in the following blog post:

http://serialseb.blogspot.com/2007/04/wpf-tips-1-have-all-your-dat...
tml

If you have any further questions on this issue, free feel to ask here, we
are glad to answer them.

--------------------------------------------------
Best regards,
Macro Zhou (v-mazho@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.

Kirill

10/22/2008 2:08:00 PM

0

Marco,

Marco Zhou [MSFT] <v-mazho@online.microsoft.com> wrote:
> In WPF, the Language property of FrameworkElement will default to US
> English, in order to override it with the current language setting, you
> could try overriding the FrameworkElement.Language property's property
> metadata as demonstrated in the following blog post:
>
> http://serialseb.blogspot.com/2007/04/wpf-tips-1-have-all-your-dat...
> tml
That's great! Thank you so much!

Kirill.

SerialSeb

10/22/2008 3:01:00 PM

0

Thanks for the link :)

"Marco Zhou [MSFT]" wrote:

> Hello,
>
> Welcome to Microsoft Newsgroup Support Service! My name is Marco Zhou. It's
> my pleasure to work with you on this thread.
>
> In WPF, the Language property of FrameworkElement will default to US
> English, in order to override it with the current language setting, you
> could try overriding the FrameworkElement.Language property's property
> metadata as demonstrated in the following blog post:
>
> http://serialseb.blogspot.com/2007/04/wpf-tips-1-have-all-your-dat...
> tml
>
> If you have any further questions on this issue, free feel to ask here, we
> are glad to answer them.
>
> --------------------------------------------------
> Best regards,
> Macro Zhou (v-mazho@online.microsoft.com, remove 'online.')
> Microsoft Online Community Support
>
> Delighting our customers is our #1 priority. We welcome your comments and
> suggestions about how we can improve the support we provide to you. Please
> feel free to let my manager know what you think of the level of service
> provided. You can send feedback directly to my manager at:
> msdnmg@microsoft.com.
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>