Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
155
How to define and load WPF resource files when WPF project is defined as a class library
posted

Normally you can define and load common resource files (brushes, styles, etc) in App.xaml file if your project is defined as console or WPF windows app. However when I define my WPF project as a class library in a normal windows app how can I define and load those resource files?

I tried to define those resource files in user control but somehow it does not work. Can some one please show me the correct syntax?

Or do we have some alternative way to define those resource files globally so every PDF user control can use it?

Thanks in advance.

Joseph

 

Parents
  • 30692
    Verified Answer
    Offline posted

    are you talking about loading a ResourceDictionary from a xaml file?

    if you instantiate a new ResourceDictionary you can set its Source property to the appropriate Uri for your xaml file. You can then retrieve resources from this ResourceDictionary.

    This help?

    -Graham

Reply Children
No Data