views:

885

answers:

3

hi there,

i wonder if there is a simple solution to change language of a wpf application during runtime. i used locbaml to globalize all the resources. Setting the Current Thread's UICulture in the App-constructor works fine, but when i try to chang it a little bit later, i doesn't reflect the changes anymore. This was actually quite easy with winforms, but i have no clue how to solve the same problem with wpf. any ideas? regards j.

+1  A: 

There's an article on CodeProject that talks about this. ("This article is about how to create a user interface in Windows Presentation Foundation (WPF) which is multilingual and where the language can be changed at runtime.")

https://secure.codeproject.com/KB/WPF/WPF-Mulit-Lingual.aspx

Odi - Xceed
nice article, but i'm actually looking for a way doing it just with locbaml-ed sattelite assemblies and not with using some foo.xml files as external resource storage, thanks though
Joachim Kerschbaumer
+1  A: 

No.

Once you load an assembly and it is bound to your application, you can not change classes in mid-work. You could create a bootstrapper assembly that loads the current language and when you change the language you close and re-open your application automatically, but I doubt that's what you want or need.

What I did on one of my projects was create a globalized application framework using converters, etc. You can see some of the problems I ran into here and especially this post which shows how it looked. HTH if you decide to go the same way as I did.

Omer van Kloeten
A: 

http://www.codeproject.com/KB/WPF/LocBamlClickOnce.aspx

thanks for the link. but there is still a need for recreating the classes loaded to the appdomain instead of just changing the language at runtime.
Joachim Kerschbaumer