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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.