View previous topic :: View next topic |
Author |
Message |
BernardG
Joined: 22 Apr 2010 Posts: 5 Location: France
|
Posted: Tue Apr 27, 2010 12:31 pm Post subject: Problem with threads ? maybe ? |
|
|
I am about done localizing my WPF application while evaluating Globalizer, it works very well. I added a menu, copying your example, everything is fine.
There is just a little annoying problem I am not sure how to solve, but I have to confess I am still new at .net and have a lot to learn!
Our connections steps are displayed to the user from an event coming from another control/thread. Those keep the Machine culture and do not change when the menu item is clicked. I tried to put CultureManager.SynchronizeThreadCulture = true, without success.
I am not sure what code would be useful for you to point me in the right direction, but here the method giving me fits:
Code: |
Private Sub TelecontrolProgressChangedHandler(ByVal progressStep As TelecontrolConnectionSteps) Handles TelecontrolControl.TelecontrolProgressChanged
Select Case progressStep
Case TelecontrolConnectionSteps.TimeoutWhileWaitingConnectionAcceptation, TelecontrolConnectionSteps.DisplayDllLoadingFails
MyUserMessageDisplay.AddMessage(Enums.MessageType.ErrorMessage, Telecontrolmanager.GetString("ConnectionStep_" & progressStep.ToString()) & " (" & myManager.GetString("StepValue:") & " '" & progressStep & "')")
Case Else
MyUserMessageDisplay.AddMessage(Enums.MessageType.InformationMessage, Telecontrolmanager.GetString("ConnectionStep_" & progressStep.ToString()) & " (" & myManager.GetString("StepValue:") & " '" & progressStep & "')")
End Select |
|
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Tue Apr 27, 2010 10:46 pm Post subject: |
|
|
For threads other than the main GUI thread you need to set the CurrentUICulture yourself if that thread is accessing culture specific resources. If the thread is a long running thread then you will probably need to set these each time before you access the resources (to handle the possibility the culture has been changed) eg:
Code: | Thread.CurrentThread.CurrentUICulture = CultureManager.UICulture; |
_________________ Infralution Support |
|
Back to top |
|
|
BernardG
Joined: 22 Apr 2010 Posts: 5 Location: France
|
Posted: Wed Apr 28, 2010 7:06 am Post subject: |
|
|
Thanks you! This works like a charm! BTW, we bought yesterday, after barely a week of evaluating your product. |
|
Back to top |
|
|
|