Dynamic Localizability—Updating the UI When the Culture Changes

The Windows Phone XAML data-binding infrastructure relies on change notification to signal that a property in a data-binding expression should be reevaluated. Generated resource designer classes do not provide change notification. Simply exposing the generated resource class for data-binding does not allow the UI to be updated when a culture change occurs at runtime. Therefore, some other means is required to update the UI when the app’s culture changes. This is the purpose of the custom BindableChangeNotifier class, shown in Listing 19.2. By using the BindableChangeNotifier class to wrap the resource’s designer class, change notification can be surreptitiously added for all properties. ...

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.