Customize the management template and still follow the OS theme?

In WPF, how do I modify a template for a standard control so that it further relates to the current theme of the operating system? If I just β€œedit a copy” of the template in blend, it just gives me the template for the current theme. It's right? Therefore, when I apply the modified template and launch the application on different topics, it will always look the same.

For user controls and even data templates, the problem is similar. How to provide a template that takes into account all possible topics of the OS?

+2
source share
1 answer

I do not think that's possible. If you create a template for a control, you replace the entire control template.

You can only use styles to set public properties, but if you change the template, you will no longer be associated with the theme. You can create a separate template override for each theme, but you will need to define them explicitly, and if Microsoft creates a new theme, you will need to create a new template to match it.

See my own question - When overriding WPF templates, do I need to override each template individually?

0
source

Source: https://habr.com/ru/post/1305094/


All Articles