How do I use global resources in WPF?

Posted by Banford on Stack Overflow See other posts from Stack Overflow or by Banford
Published on 2010-05-26T09:53:27Z Indexed on 2010/05/26 21:01 UTC
Read the original article Hit count: 261

Filed under:
|

I have a WPF application which I would like to use some static resources in. I have created a Resource Library XAML file which contains a resource. I have also added a string into the Resources of the project through the Properties panel.

I assumed I could just use these resources with the binding expression:

{StaticResource ResourceName}

But visual studio is telling me the resources are not found. Do I have to include some form of reference in my XAML? The examples I have seen only include resources locally such as:

<Window.Resources>, <Page.Resources> etc

I don't want to include the resources locally because I want them to be available to multiple parts of the application.

© Stack Overflow or respective owner

Related posts about .NET

Related posts about wpf