I have read lots of examples. And what I have seems right. But when it comes to loading it fails.
Here is my code:
LargeImage=new BitmapImage(new Uri("pack://application:,,,/Images/books_48.png"))
This code runs in AssemblyA. AssemblyA's project also has a folder in it called Images. That folder has a file called books_48.png. It is set to compile as "Resource" and never copy.
I used DotPeek to see if the Image is in the AssemblyA.dll and it is there.
The first reference to LargeImage
is in AssemblyB. It binds LargeImage to a FluentRibbon Fluent:Button.LargeIcon.
When it comes time to load the BitmapImage I get this error:
Cannot locate resource 'images/books_48.png'.
Any ideas on how to get this to load?
NOTE: I have also tried these:
"pack://application:,,,/AssemblyA;component/Images/books_48.png"
"pack://application:,,,/AssemblyA;Images/books_48.png"
"pack://application:,,,/AssemblyA;/Images/books_48.png"
"pack://application:,,,/Images/books_48.png"
"pack://application:,,,Images/books_48.png"
"Images/books_48.png"
"/Images/books_48.png"
They all give me errors (either "can't find it" or "invalid URI" kind of errors).