Displaying Localized Text and Images Within the LocalizabilityView Page

The view’s XAML file is entirely absent of literal strings. The BindableResources instance is used to retrieve all localized resource strings (see Listing 19.4).

A ListBox is bound to the viewmodel’s SupportedCultures property. Selecting a value causes the current thread’s CurrentCulture and CurrentUICulture to be set to a new CultureInfo instance. The BindableResources.RaisePropertyChanged method is then called to trigger an update of the UI. The NativeName property of the CultureInfo class displays the culture name’s endonym.

The flag image is also bound to the BindableResources. The binding uses the BitmapImageConverter, which was presented earlier in this chapter, to ...

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.