maybe it's very simple, but how to change the culture in code behind to allow the wpflocalizeextension to show the desired resource?
I tried to change the application culture, but it did nothing!!
maybe it's very simple, but how to change the culture in code behind to allow the wpflocalizeextension to show the desired resource?
I tried to change the application culture, but it did nothing!!
In order to change the current culture at runtime you use the following two statements. With SetCurrentThreadCulture
, also the culture of the current thread is updated.
WPFLocalizeExtension.Engine.LocalizeDictionary.Instance.SetCurrentThreadCulture = true;
WPFLocalizeExtension.Engine.LocalizeDictionary.Instance.Culture = new CultureInfo("en");
To get a list of available CultureInfo
objects, you can use
WPFLocalizeExtension.Engine.LocalizeDictionary.Instance.MergedAvailableCultures
Try something like this?
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US");
CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("en-US");