在哪里可以找到默认的WPF控件模板? [英] Where can i find the default WPF Control templates?

查看:367
本文介绍了在哪里可以找到默认的WPF控件模板?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

按照此 MSDN 链接

没有办法只替换一部分 控件的可视树的;到 改变控件的视觉树 您必须将的模板属性设置为 控制到新的和完整的 ControlTemplate

There is no way to replace only part of the visual tree of a control; to change the visual tree of a control you must set the Template property of the control to its new and complete ControlTemplate

.

我正在尝试禁用GridViewColumnHeader的单击行为(我需要删除原始控件模板中的一些触发器),但是我找不到本地的"ColumnHeaderContainerStyle".我发现的所有对象似乎都已经进行了一些自定义,并且很难获得原始的外观和感觉.

I am trying to disable the click behaviour of GridViewColumnHeader ( I need to remove some triggers in the original control template), but i am not able to find the native "ColumnHeaderContainerStyle". All those i have found seem to have already done some customization and it is being difficult to get the original look and feel.

有人可以建议我如何/在何处获得本机WPF控件中定义的原始控件模板吗?

Can someone please suggest me how/where can i get the original control templates as defined in the native WPF controls?

感谢您的关注.

推荐答案

您可以找到所有主题的模板在MSDN上.

(链接应直接将您带到页面上的正确位置.加载整个页面(可能需要几秒钟)后,主题"部分应位于浏览器内容的顶部.)

(The link should take you directly to the correct location on the page. After the whole page is loaded (might take some seconds), the "Themes" section should be at the top of your browser's content.)

编辑:似乎上面的链接不再起作用.请参阅McGarnagle在帖子中给出的链接.

It seems like the link above does not work any longer. Please refer to the link given in the post by McGarnagle.

此外,还有几种工具可以读取装配体中的样式.例如,您可以使用 Style Snooper .但是,对于您的情况(获取内置模板),上面的MSDN链接应该是最简单的.

Furthermore, there are several tools out there which can read the styles from an assembly. For example, you could use Style Snooper. However, for your scenario (getting the built-in templates), the above MSDN link should be the easiest.

这篇关于在哪里可以找到默认的WPF控件模板?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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