I want my Prism shell to display an image and label for each module that it discovers. How might I go about including an image from a module assembly and accessing it in the shell?
I've already tried creating an interface for providing an icon (as an ImageSource
) and a string label, but I am having trouble creating the ImageSource
from the image in the module's assembly. (The URI used in the constructor for a BitmapImage
always wants to find content in the shell's assembly rather than the module's assembly.)
I was thinking that I could add an image as a resource and just use that, but it is represented in code as a System.Drawing.Bitmap
and I couldn't find an obvious way to convert that to a type usable in the WPF shell. (I did see some code for converting from a Bitmap
, but that feels like the wrong approach. Might have to settle with that, though.) [Edit: That approach does actually work, but I still think it smells.]