Reputation: 13374
I'd like to share some assets like icons between multiple WinRT projects.
With WPF this was a no-brainer (well almost):
What's the best way of sharing them with Windows Runtime?
Is there such a resource embedding and sharing capability, or any other solution?
If no I guess I could add them to every project with "Copy as link" but I hope there is a clean way.
EDIT: I've started to do it naively like I would in a WPF project:
But I can't reference the image with the new URI format:
<Image Source="ms-resource://Assets/Files/Mushroom.png"></Image>
Upvotes: 5
Views: 2357
Reputation: 113
It is very simple. Right click on the folder where you want the images (e.g., an Assets folder in the new Project) and the select "Add/Existing Item". Then select the images that you need and be sure to change the "Add" button, to "Add as Link". Done.
Upvotes: 0
Reputation: 13374
So finally I got the correct result.
Here is the full process:
To reference the image itself you must:
specify an absolute path with /// not //
<Image Source="ms-appx:///Assets/Mushroom.png">
And above all don't trust the Visual Studio designer:
Hope this helps...
Upvotes: 4