0

SOLVED

Accepted answer from here did the trick (using converter)


I have resources.dll which contains not one, but multiple resource files like

  • A.resx
  • B.resx

Inside A.resx I have

  • string TestString
  • image TestImage

I'm referencing this dll in my project.

Inside xaml I have namespace declared

xmlns:res="clr-namespace:Resources;assembly=Resources"

and I'm trying to get content from resource A.resx.

This one works fine, I can get string from A.resx

<Label Content="{x:Static res:A.TestString}"/>

but I can't access image like this

<Image Source="{x:Static res:A.TestImage}" />

The member TestImage is not recognised or accessible

A.resx has

  • access modifier set to public
  • build action to Embedded Resource
  • image persistence is set to Linked at compile time

If I can get string from it, but can't get image then I have access to resx file and I can rule out permission/access problems. So there must be something that I'm doing wrong with this image.

Question is: why I can't get image from resx file and how to get this work?

Community
  • 1
  • 1
a''
  • 2,322
  • 2
  • 23
  • 34
  • *image persistence is set to `Linked` at compile time* - set `Embedded`. – Sinatr Oct 22 '14 at 12:58
  • Maybe you have to specify image *path* in full form ``, see [here](http://stackoverflow.com/q/347614/1997232). Can you use designer to generate path for you? Move cursor inside ``, hit Alt+Enter and open dropdown editbox for `Source`. Is there anything? If you click `TestImage` there, what will be generated in xaml? – Sinatr Oct 22 '14 at 14:22

0 Answers0