I have a business application (created from a template), and I can dynamically change the language by creating ResourceWrapper INotifyPropertyChanged and then adding to the code:
private void Language_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
Thread.CurrentThread.CurrentCulture =
new CultureInfo(((ComboBoxItem)((ComboBox)sender).SelectedItem).Tag.ToString());
Thread.CurrentThread.CurrentUICulture =
new CultureInfo(((ComboBoxItem)((ComboBox)sender).SelectedItem).Tag.ToString());
((ResourceWrapper)App.Current.Resources["ResourceWrapper"]).ApplicationStrings =
new ApplicationStrings();
}
this works fine with the resources referenced / bound in xaml files (i.e. the MainPage frame), but does not update the links to everything that I declared in the ie code
InfoLabel.Content = ApplicationStrings.SomeString
I am not currently using ResourceWrapper. My question here is how can I change my code so that it uses it and is updated when ResourceWrapper changes. I tried:
InfoLabel.Content = ((ResourceWrapper)App.Current.Resources["ResourceWrapper"])
.ApplicationStrings.SomeString
but that will not work.
Any ideas?
Artur source
share