Thursday, December 20, 2012

How to set Silveright 5 CurrentCulture & CurrentUICulture separately on DatePicker & TimePicker Control?

How to set Silveright 5 CurrentCulture & CurrentUICulture separately on DatePicker & TimePicker Control?

I have set two different culture to the thread as :

Thread.CurrentThread.CurrentCulture = "fi-FI" Thread.CurrentThread.CurrentUICulture = "en-Us"

But the calender text is shown in Finnish culture.

I need to keep the Text(Translations) based on CurrentUICulture and Text Format based on CurrentCulture.

Can you please suggest how can it be done for it ?

Thanks

Answers & Comments...

Answer: 1

That is not possible. The Calendar control only reacts to the CurrentCulture value. CurrentUICulture is used by the ResourceManager to load up different strings, images etc. used in the UI, but that is not where the day/month names are stored. They are part of the .NET framework itself. To get the functionality you want you will have to write your own implementation of the DatePicker and/or TimePicker controls. Perhaps you could download the code for the Silverlight Toolkit and use that as a base for your own implementation. What you are looking for is basically a way of overriding the names of months and days manually. Maybe it is even possible to extend the controls and add that functionality on top, but I doubt it.

by : Henrik Söderlundhttp://stackoverflow.com/users/250605




No comments:

Post a Comment

Send us your comment related to the topic mentioned on the blog