In the WinRT application, the new localization is applied when the application is restarted (using code or by changing the language from the control panel). What if I want to change localized strings on the fly without restarting the application?
Suppose I have a combo box with different languages. If the user selects a language, all lines will be translated using the resource.
I came across this code, but it only works if I put it in the constructor of the App , which is also on startup. I cannot do this with a static method since it does not work.
var culture = new System.Globalization.CultureInfo("en-US"); Windows.Globalization.ApplicationLanguages.PrimaryLanguageOverride = culture.Name; System.Globalization.CultureInfo.DefaultThreadCurrentCulture = culture; System.Globalization.CultureInfo.DefaultThreadCurrentUICulture = culture;
I want something like below this image. Image from a CodeProject article.

c # windows-8 windows-store-apps windows-runtime winrt-xaml
Xyroid
source share