Hi,
The problem:
The returned localized string for the non-string binding properties (DateTime, double...) is always set to "en-US" culture, regardless of the CurrentThread.CurrentCulture.
The solution I am looking for:
I am looking for a solution other than using a converter (The localization works properly if a converter is used), since I need to implement it in an existing large Silverlight3 application where converters were not used in the first palce.
The Question:
How to make localization work with non-string binding properties, without converters ?
thnx
Krsto
views:
151answers:
1
+2
A:
Do the following in the constructor of your App.Xaml:
Thread.CurrentThread.CurrentCulture = new CultureInfo("sv-SE");
And then this in the constructor of every user control:
this.Language = XmlLanguage.GetLanguage(Thread.CurrentThread.CurrentCulture.Name);
That might work, give it a try. Of course you will have to adjust the culture to whatever it is you want to do.
Henrik Söderlund
2010-01-19 12:42:06