views:

331

answers:

2

I have the following scenario:

  1. Create a new class library project called Lib1 1.1. Add a new control called control1, Themes/generic.xaml file and specify the default style of control1.
  2. Create a new class library project called lib2. 2.1.Add a new control called control2, Themes/generic.xaml file and specify the default style of control2. In the dafaultStyle of control2 I use control1.

My question is: Do I have to copy/paste the defaultStyle xaml of control1 into the generic.xaml of lib2, to use control1 with its style applied in control2?

+2  A: 

The default style lookup for a Control is always done in the assembly that the Control is defined in. So if Control1 is defined in Lib1.dll, the default style will always be looked for in generic.xaml in Lib1.dll. It doesn't matter where the Control is being used from.

KeithMahoney
+1  A: 
Scott