开发者

What's the recommended way to expose standard colors in WPF

I would normally just create a static class like StandardFoo开发者_StackOverflow社区Colors and create a static field for each standard color. However, with WPF I could also put these in a resource dictionary. Just wondering if there is a recommended way to do this or if it is 6 of 1 or half dozen of the other?


I suggest you use a ResourceDictionary. This will also give you the option to associate color (xaml) files with different "skins", and easily switch between them on-the-fly.

Plus, it is easier to define complex colors and brushes in xaml than it is in code.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜