I have a question regarding Pack Uri.
I created a WPF .NET 4.5 application. I would like to make it quite modular to be open for 3rd party plugins; so i split it up in three projects.
My Configurator executable will be the main entrance point. This configurator assembly references a Types.dll, which contains most of my base logic. For my guided user interface, I use a third project, called UserInterface.dll
Now my types.dll contains an image file, which I would like to use as resource in my UserInterface.dll.
If I try to call it e.g. using:
Image img = new Image();
img.Source = new BitmapImage(new Uri("/Types;component/Resources/myPicture.png", UriKind.Relative);
The image will not show up, because it cannot not found. My executing assembly is UserInterface.dll, but Types.dll is referenced in Visual Studio. Same effect using absolute Uris (application,,,:).
I did a work around defining my image as Resource (Project Property) and load the Drawing.Bitmap, convert it to an ImageSource and assigning it to my image. But I think it is not as performant as loading it directly via ImageSource.
So my question is: How can I load a resource in a called assembly from another assembly, when both are not the main application?
Thanks for your help.
EDIT:
The images's build action is set to Resource.