When I switch the language (localization) it only affects newly created windows. How to update localized texts for currently opened windows? I mean, smart way, so let's say if I have textbox and button, and I already entered some data the localization switch should not affect it:
[ 5 _ ] cancel
--> switch to polish (for example)
[ 5 _ ] anuluj
SOLVED
Thanks to article pointed out by Wouter Janssens - Xelos (thank you again) I was able to solve this. In case somebody reads several years later :-) those are the essential steps (read the mentioned article first):
- Add to your App.xaml ObjectDataProvider tag
- In App.xaml.cs add minimal provider wrapper -- getter of ObjectDataProvider from xaml and resource getter method
In xamls refer to all your localized texts not via
"{x:Static loc:Resources.MyStringKey}"
(where loc is Properties namespace of your project) but
"{Binding Path=MyStringKey, Source={StaticResource CultureProvider}}"
(where CultureProvider is the name of the ObjectDataProvider object created in step 1)
- On localization switch refresh the provider.