views:

43

answers:

1

In WPF how do I modifiy the template for a standard control in a way that it will respect the current Theme of the Operating System later on? If I just "edit a copy" of the template in blend, it will just give me the template of the currently running theme. Is this correct? So when I apply the modified template and run the app on different themes it will always look the same.

For custom controls and even for data templates the problem is similar. How do I provide a template that respects all possible themes of the OS?

A: 

I don't think this is possible. If you create a template for a control you are replacing the entire control template.

You can use styles to just configure exposed properties, but if you change the template, you are no longer related to the theme. You can create a separate override of the template for each theme, but you would have to define each explicitly and if Microsoft created a new theme you would have to create a new template to match it.

See my own related question - When overriding WPF templates do I have to override each theme’s template separately?

Simon P Stevens