I need to put an image in the default view of a custom control. However, whenever I try to test the control it can't locate the image. I have tried to compile it as an embedded resource and just a plain resource in VS. Neither of these have worked. So is there a correct way to do this?
+2
A:
Look at this post: How can I get a BitmapImage from a Resource?
Sergey Aldoukhov
2009-06-08 07:26:51
+1
A:
That's probably because you specified the image path as a relative path. You should use the Pack URI Scheme to specify that the resource is in the current assembly. For instance :
<Image Source="pack://application:,,,/Images/MyImage.png"/>
Thomas Levesque
2009-06-10 10:09:49