Quantcast
Channel: Silverlight Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 801

Created Issue: Fail to force to use 'en-US' in RelativeTimeConverter [10884]

$
0
0
I'm using the latest Toolkit for Windows Phone SDK 7.1.
I want to force app to use 'en-US' culture.
I modify sample code:
<TextBlock Text="{Binding DateAndTime, Converter={StaticResource RelativeTimeConverter}, ConverterCulture='en-US'}"

But it's still not english in my chinese culture emulator.
I look into the control source code:
RelativeTimeConverter.cs Line 76 Method: SetLocalizationCulture
If the input parameter is 'en-US' already, it will not set ControlResources.Culture which has default value null!
So in the next code, when try to get properties, calling ResourceManager.GetString, second parameter will be null too, it will use thread culture.
http://msdn.microsoft.com/en-us/library/bsb0cfet.aspx

So my suggetion is to set ControlResources.Culture to DefaultCulture in the begining of Convert method.

Viewing all articles
Browse latest Browse all 801

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>