WPF中现有控件的ControlTemplate [英] ControlTemplate for existing controls in WPF

查看:286
本文介绍了WPF中现有控件的ControlTemplate的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何以XAML格式(可视树)以WPF获取现有控件的ControlTemplate?
这是为了帮助在现有模板的帮助下创建新的ControlTemplate。

How to get existing control's ControlTemplate in WPF in XAML format (visual tree)? This is to help to create new ControlTemplate with the help of existing template.

推荐答案

样式以及模板示例已在MSDN上 下载,请参见 默认WPF主题链接

The styles along with template examples are up on MSDN for download, see the Default WPF Themes link.

不过,您也可以使用 BasedOn 扩展现有样式而无需重新定义所有内容code>属性。

However you can also extend the existing style without redefining everything by using the BasedOn attribute.

这篇关于WPF中现有控件的ControlTemplate的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆