I feel like I've solved this problem 10 times before but I can never remember how exactly to do it, since someone decided to make pack uris in xaml complete rocket science..
I have an image marked as a resource. I have a xaml UserControl in a class library (a dll) that needs to reference this image in markup. I have this UserControl and image in two dlls - a Silverlight version and a WPF version.
The image is in the same directory as the UserControl in both versions. It's marked as "Resource"
I have a Silverlight app that references the Silverlight dll and a WPF app that references the WPF dll.
How can I make my xaml reference the image with an assembly local relative URI, keeping in mind the following:
- I don't know the assembly name, since the SL and WPF assemblies have different names.
- The Silverlight and WPF dlls have different paths relative to the root of the assembly (the SL version of the UserControl and image are linked files under a directory named "Linked" in the SL project.
I've tried using
./MyImage.png
MyImage.png
/MyImage.png (which I know shouldn't work)