I need to support UI language change through the application menu.
The texts are localized using resource files (similar to approach 1 here)
if I set the Thread.CurrentThread.CurrentUICulture before the ctor calls to InitializeComponent(), the UI is changed as it should.
However, if the CurrentUICulture is changed during the normal run of the application, the controls are not updated (i.e. the text remains the same, regardless of the current culture).
Is there a way to force the controls to refresh according the the CurrentUICulture?
You could use the
ResourceDictionaryapproach along with theDynamicResourceMarkupExtension. Using this approach you can swap out the resource dictionary representing the language the user has selected and theDynamicResourceMarkupExtensionwill ensure the new value is reflected in the UI.Also, if you’re willing to venture into the realm of a custom solution, there is the
LocalizeMarkupExtensionwhich is provided in this WPF tutorial.