In my Silverlight 4 MVVM application, I can switch languages ββat runtime:
public void SetLanguage(string language) { var culture = new CultureInfo(language); Thread.CurrentThread.CurrentUICulture = culture; Thread.CurrentThread.CurrentCulture = culture;
For inputs, I simply added "ValidatesOnException = true" in case of problems with the conversion and does the job. But the default exception message refers to my OS culture, not a manually selected one.
In this thread of localizing exception messages, the idea is to change the CurrentCulture and CurrentUICulture that I made. So I'm a little stuck.
What can I do?
Thanks:)
Edit: I tried using a custom converter with a custom exception in the conversion method to verify user input. The problem, the exception in the conversion method is NOT caught by validatesOnException, it interrupts the application.
Edit 2: clarify -> if I have a decimal property associated with a text field and I enter "blabla" in this text field, I want to see that there is a problem, and I want the message to be in runtime, and not the locale OS I cannot throw an exception in my property installer, because I never get there, the default converter creates its own exception before that.
Hope this is clear. If I can help you, please feel free to :)
Maxime ARNSTAMM
source share