R – How to display an image in Silverlight

imagesilverlightsilverlight-3.0

This should be simple, but…

I created a folder in my solution called Images. I dragged an image into it. How do I now display this image on a Page or View?

Best Answer

Make sure the image is set as a Resource. It can be in any folder in any of your projects in your solution.

You can then reference this as [assembly];component/[path]/[imagename.extension]

For example:

<Image Source="/mynamespace.myassembly;component/ResourcesFolder/image.png" Width="16" Height="16" />