WPF: Button Template vs ContentTemplate

2019-02-22 04:53发布

Can I say that usually, in WPF, properties Template contains ContentTemplate? Or else, whats the difference?

3条回答
Ridiculous、
2楼-- · 2019-02-22 05:13

Template defines the appearance of the control. ContentTemplate specifies how the content contained in/displayed by a ContentControl is to be displayed.

Here's a Social.MSDN thread containing an example that shows the difference between the two.

Hope this helps,
Ben

查看更多
时光不老,我们不散
3楼-- · 2019-02-22 05:15

Template's value type is controlTemplate, which defines how control should looks like.

ContentTemplate's value type is dataTemplate, which define the how data should looks like. The similar property is ItemTemplate and CellTemplate.

查看更多
登录 后发表回答