Question

I have a Silverlight application. I want to store the last culture information used by the user. By default , the culture information is derived from the OS. Now if the user changes the culture in his/her login, when the next he/she logins, they should get the same culture. So the OS culture and Application may be different from next login. In short I want to save my last culture used in Isolated Storage in Silverlight. I have used : Thread.CurrentThread.CurrentUICulture.ToString() But I am not getting the expected results.

How to do it?

Was it helpful?

Solution

I would suggest you save both CultureInfo.CurrentCulture.Name (for regional formatting) and CultureInfo.CurrentUICulture.Name (for language) as you may want user to use one of supported application languages (e.g. en-US) and local formatting (e.g. jp-JP).

How do you restore the user settings from isolated storage? Do you assign Thread.CurrentThread.CurrentCulture when application is initialized in App.xaml?

Moreover, you may need to assign Page.Language from the settings (such as when a page is created, assign it as follows:

this.Lanaguage = XmlLanguage.GetLanguage(System.Threading.Thread.CurrentThread.CurrentUICulture.Name)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top