I am posting this and will answer it because of the lack of working, marked correct, solutions to this on SO.
The issue is when you create custom controls or external libraries that use images, the images may not show up in the program that uses the library.
In my specific case I have user controls that use a custom control base class.
For some reason the image would appear in the design view of the usercontrol, and external program's design window. however, on running it would not have the image displayed in the external program window.
I tried all of the following from other solutions on SO:
- using the
pack://,,,
command in the xaml of the DP (works in design views) - referencing the individual xaml files in the external program (this is a bad idea from a OO & SOLID point of view)
- Using
../
before the URI string (works in design views) - Using
EmbeddedResource
for the build of the Images - Creating a converter to process the string (unnecessary and adds extra garbage to the system as well as not working very well)
- Creating extra dependency properties on the custom control (Messy and a bad idea from a binding point of view)
- Using
assembly;component/[folder name]/[image name]
(works in design views) - Using
[folder name/image name]
(works in design views) - Changing the
assemblyinfo.cs
file and the static constructor of the custom class to include theGeneric.xaml
file.