9

Seems to be different in WinRT (Windows 8). Anyone figure it out yet?

My experiments.

Of course:

File Build Action == Content && Copy to Output Directory == Copy always

These don't seem to work:

<Image Source="Folder/file.jpg" />
<Image Source="/Folder/file.jpg" />
<Image Source="Namespace;Folder/file.jpg" />
<Image Source="Namespace;/Folder/file.jpg" />
<Image Source="pack://Namespace;Folder/file.jpg" />
<Image Source="pack://Namespace;/Folder/file.jpg" />

Out of desperation I tried:

File Build Action == Embedded Resource && Copy to Output Directory == Copy always

Still fail. Ugh!

Cœur
  • 37,241
  • 25
  • 195
  • 267
Jerry Nixon
  • 31,313
  • 14
  • 117
  • 233

1 Answers1

15
<Image Source = "ms-appx:///<projectName>/<folderName>/<contentName>" />

For example ...

<Image Source = "ms-appx:///ClassLibrary1/Content/myimage.png" />

See How to Reference Content for a bit more info.

JP Alioto
  • 44,864
  • 6
  • 88
  • 112