Localizing Images Using Resx Files

The Resx Designer in Visual Studio 2012 has been improved and now provides better support for image files.

An image file can be added to a resx file by opening the resx file in design view and by selecting the Images item in the Resx Designer. You can then drag and drop an image file onto the Resx Designer surface.

An Image control can now be bound to a localized image, as shown in the following excerpt:

<Image Source="{Binding Resources.Instance.ImageResourceName,       Source={StaticResource BindableResources},       Converter={StaticResource BitmapImageConverter}}" />

As in the previous string resources example, the data-binding’s Source property uses the ResourceBindingWrapper ...

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.