"Essential WPF - Chapter 8 Styles" 阅读笔记

Chapter 8 Styles

 

8.3 Using Styles for Good, Not Evil

 

8.3.1 Build Themes, Not Styles

 

Consequently, generally the best practice is to think of a theme as a “thing” rather than just a collection of styles at the root window in the application.

 

The first piece of concrete advice I would give is to move the definition of the theme into a separate file and use the merged-dictionaries feature to bind the theme into the application. Even better, move the theme definition to a separate assembly and use a cross-assembly reference to load the style (/<assemblyName>;component/<resourceName>):

 

8.3.2 Consistency Is King

 

When building a custom look and feel for an application, it is important to make it consistent across all the controls that will be used.

 

One of the goals of WPF was to make every control customizable so that we wouldn’t get the “Frankenstein” applications often seen with older forms packages (appearing as if the UI had been stitched together using parts of other applications).

 

8.3.3 Have a Point

 

Custom themes allow us to differentiate one application from others. Creating a custom theme is potentially expensive, in terms of both design and implementation.

 

The key thing is that a custom theme should convey something to the user.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值