Reputation: 21072
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
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):
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)
Upvotes: 0
Views: 973
Reputation: 17931
How about having a dependency property bind to button text. so when the property value changes the binding also updates
Upvotes: 1