|
-
November 20th, 2007, 11:36 AM
#1
WPF: Change the culture when application runs.
Hi all,
I’m very very new in C#/WPF world, but this fascinates me more and more. Now I must find a way how our future application will use the localization / globalization. I did all the steps I found in MSDN to create this (UID, LocBaml, satellite, etc.) and I it works perfect (a little bit complicated but anyway it works). The application starts in the OS culture starts, also if I put at the beginning this code:
public App()
{
Thread.CurrentThread.CurrentUICulture = new CultureInfo("de-DE");
//Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
}
It works perfect.
Now I try (and I spent too much time for this issue) to change the culture online, when the application runs. Something like:
private void CheckLanguage(object sender, RoutedEventArgs e)
{
Thread.CurrentThread.CurrentUICulture = new CultureInfo((german) ? "de-DE" : "en-US", true);
}
When the user clicks a button to change from german to English. I guess I’m too naive to believe that, but I don’t know what should I write so to get my current main window show all stuff in other language?
For any idea thank you in advance!
Best regards,
Emanuil
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|