Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

change culture using wpflocalizeextension

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!!

like image 299
omarmallat Avatar asked Feb 09 '16 11:02

omarmallat


1 Answers

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
like image 152
M.E. Avatar answered Nov 13 '22 15:11

M.E.