C # / WPF: how do I separate the structure from the styles like in web programming?

When programming for the Internet, you usually separate the structure from the style using HTML and CSS separation.

How to do this in a WPF project? All the examples that I find use the "inline" style. Is it even possible? Does that even make sense in WPF?

+3
source share
1 answer

You can pull all the styles into separate XAML files and only reference them from the XAML files that define your user interface structure. ResourceDictionaryhere is your friend.

Actually, both are common and recommended in WPF.

+2
source

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


All Articles