开发者

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

When programming for the web, you normally separate stru开发者_运维技巧cture from style using a separation of HTML and CSS.

How do I accomplish the same in a WPF project? All the examples I find use "inline" styling. Is it possible at all? Does it even make any sense in WPF?


You can pull out all styles into separate XAML files and only reference them from the XAML files that define your UI structure. ResourceDictionarys are your friend here.

Actually that's both common and recommended in WPF.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜