silverlight - Changing the UI language dynamically -


I have a multi-language menopause application where resources are stored in RAZ files for different languages ​​and buttons Is bound to The contents of the label are within the XML properties.

When you set the UI culture of the thread in the creator of Silverlight's page, everything works fine, but when it changes depending on the user's selection (via the combo box selection) Changes I need a page to rearrange the control files on the UI culture of the new thread and to reboot into the resource files.

I'm not sure which mechanism to tie your approach to your localization repository I'm using, but I guess the problem is with notification.

This view will update the data in only one binding, the possibility of being the most notified of a notification event, the object of the localization data that you are binding when the culture changes, is not sending the notification.

You can consider by changing an introvert properties to an object that holds your localization strings. Then, add a method to the class named "NotifyThatEverythingChanged" in that method, only send the string of that property. Has changed to the sky, which tells the UI to update everything in the data context.

In my case, I have an object that is called RESX for myself called MyUITtrings. It contains a bunch of fixed strings in it, I have received from that class, and add functionality to notify that everything Has changed. The UI will work accordingly:

  Public class NotifyableUIStrings: MyUITtrings, INotifyPropertyChanged {Public Zero NotifyThatEverythingChanged () {OnPropertyChanged (string.Empty); } Secure void OnPropertyChanged (string propertyName) {var handlers = property changed; If (handlers! = Null) handler (this, new property change event event (property name)); } Private Event PropertyChangedEventHandler PropertyChanged; }  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -