Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hello

I created a custom content control with its default template.
The template though is not located in the location "Themes\Generic.xaml" as it is supposed to be. Instead I placed it in a separate resource dictionary with a different name.
It is merged along with other resource dictionaries in the App.xaml resource dictionary.

Running the code yielded no errors and the control is visible. I tested the application on other machines and the code ran just fine , I would like to point out that these machines are development machines.

Testing the application on the client machines (non development) then revealed some strange behaviour. The custom control was not visible; it would only be visible on 1 out 3 client machines.

I was able to fix the problem by putting the template in "Themes\Generic.xaml".

My question is how was it able to work without having to put the template in "Themes\Generic.xaml" ? I have searched on Google but I could find any clear cut explaination .

Thank you
Posted
Updated 25-Jul-14 4:26am
v2

1 solution

if you provide DefaultStyleKey=typeof(ControlEx)
only that time it will search for template in Themes/Generic.xaml
otherwise it will take base class template .
 
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