The best way to share assets such as images between projects

I would like to share some assets as icons between several WinRT projects.

With WPF, this was no problem (well, almost):

  • create a library project for assets
  • mark assets as resources to embed them in the generated assembly
  • Link to project assets from other projects
  • refer to the icons from the XAML code using the somewhat weird URI pack format .

What is the best way to share them with Windows Runtime?

Is there such an opportunity to implement and share resources or any other solution?

If I don’t think I could add them to each project using Copy as Link, but I hope there is a clean way.

EDIT: I started doing it naively, as in a WPF project:

  • I created a new Assets library project and added the image inside as “Content”
  • I refer to this project from my main project

But I can not refer to the image with the new URI format:

<Image Source="ms-resource://Assets/Files/Mushroom.png"></Image>
+4
source share
1 answer

So, I got the correct result.

Here is the complete process:

  • create a library project, add an image and set its assembly action as " Content "
  • .

, :

  • "ms-appx" , ms-resource ", Google
  • /// //

    < = "ms-appx:///Assets/Mushroom.png" >

Visual Studio:

  • ,
  • , ( ), !

, ...

+3

All Articles