Click here to Skip to main content
15,891,976 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All!

Im facing problem to apply style in classlibrary project (project A) window which refers styles from another classlibrary assembly (project B).

The problem is kind of trivial. In project A window I have applied reference as usual in xaml using ResourceDictionary.MergedDictionaries (like in app.xaml when developing exe project).

If I put eg. button on that window and refer to my button style Style="{StaticResource myButtonStyle}" It works! Style will be applied on that button on desing time and ofcourse when calling that window from exe project. This will apply all components inside that window.

The problem comes if i style window itself I receive "recource could not be resolved"!?

The referred style itself works on Exe project because target window will be styled as expected but on class library project it fails.

Hope you got idea :)

Cheers!
Posted

1 solution

I kindof figured it out. In window case it seems that I shoud refer to style using "DynamicResource" istead of "StaticResource". Dont know what is behind that... controls inside window can be styled by "StaticResource" though
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900