How to locate resources in WinRT Metro App

MS invented another URI format for WinRT resources. For example, to set the Image.Source attribute on WinRT Metro App follow this steps:

  1. Define a new Image
  2. Add the Source attribute in the code behind
Image image = new Image();
image.Source = new BitmapImage(new Uri("ms-resource://MyAssembly/.../image.png", UriKind.ReletiveOrAbsolute));

You’ve to add the path above to locate the resouce in WinRT Metro App.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s