My solution contains two projects, one is class library and the other is windows store app blank page project. There's a user control in my class library project, and in the user control, there's an image, the image's property set as embedded resource. But when I use the user control in my xaml page, the image doesnt' display. Anyone can help?
Asked
Active
Viewed 360 times
2 Answers
1
Change the Build Type from "Embedded Resource" to "Content"

Jim O'Neil
- 23,344
- 7
- 42
- 67
-
Hi @Jim, thanks for your reply, but I want to compile the image to the dll – James Dec 28 '12 at 02:05
-
ah ok... in WPF you could do something explicit like Source="/ClassLibrary;component/Images/WP_000170.jpg", but I'm not having luck with that in Windows 8 Store apps... still researching. – Jim O'Neil Dec 28 '12 at 02:57
-
looks like you'll have to pull the resource out and assign the property via code using [GetManifestResourceStream](http://msdn.microsoft.com/en-us/library/xc4235zt%28v=VS.85%29.aspx). Take a look at the [responses here](http://stackoverflow.com/questions/3314140/how-to-read-embedded-resource-text-file) – Jim O'Neil Dec 28 '12 at 20:08
0
Most probably your image file is not showing up in the solution explorer..
Go to your Solution explorer,
right click and select "Add"
select "existing item" and add your image name..
that should do the trick...

user1848880
- 77
- 10