views:

249

answers:

1

Hi,

there are many related questions/answers about that in SO. I took a look to some of them but none really match.

An assembly (called ResourcesLoader) holds images as embedded ressources.

I would like to use these pictures in another assembly.

After looking at msdn pack uri, and seeing a lots of samples, I thought that the following line would do the job :

<Image Source="pack://application:,,,/ResourceLoader;component/Resource Files/Bitmaps/bmp20x20/Cancel.png" />

Guess what? It does not work! I have checked letter by letter several times to make sure there is no mistakes.

I tried with resource images and it worked. But I have to use embedded resources...

Who can give me the magical syntax? Thanks!

+1  A: 

Hi,

What is the build action set on this resource?. The Build Action should be Resource instead of Embedded Resource.

Thanks, but the point of my question is to find the correct syntax working with Embedded Resource, not Resource. I have to use Embedded Resources.
rockeye
HiFrom the information I got from the MCTS Training Kit book for on WPF Embedded Resources can not be accessed using the "Pack URI" syntax. This is what I Found in MSDNURI resolution does not apply for URIs that refer to the following: Content files in referenced assemblies: these file types are not supported by WPF. Embedded files in referenced assemblies: URIs that identify them are unique because they include both the name of the referenced assembly and the ;component suffix. I think you should look for other ways to access your resource
Thanks. It's always a pain remembering whether to use Content/Resource/Embedded Resource.
Echilon