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

查看:40
本文介绍了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 属性扩展现有样式,而无需重新定义所有内容.

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

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

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