Skip to content

MVVM LocalizationBinding does not seem to work #6

Description

@Awsmolak

Running MVVMExample, labels that are bound to the view models using LocalizationBinding do not switch languages.
Notice "Last Name" and "Age" do not update when language is switched, while elements directly connected to ResourceKeys do.

I did some poking around in the source to see if I could fix the issue, but didn't find anything obvious.

For anyone else that runs into this problem:
Simply attach to the ResourceDisctionaryChangedEvent in your ViewModel and fire NotifyPropertyChanged to update properties.

More or less this:

var glApp = CommonUI.App.Current as GlobalizedApplication;
glApp.GlobalizationManager.ResourceDictionaryChangedEvent  += (source, args) => 
{
     NotifyPropertyChanged(string.Empty);
};

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions