开发者

RegisterClassHandler vs. AddHandler In WPF Custom Control

When writing a WPF custom control, there is sometime the need to capture child elements events in order to implement some logic.

One alternative is to hook to events in OnApp开发者_运维百科lyTemplate (and unhook in OnTemplateChanged).

Another alternative is to use RegisterClassHandler in a static constructor.

What are the pros and cons for each alternative?

Thanks.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜