查看 WPF 控件模板的文档/实用程序?
是否有文档/实用程序显示给定控件的默认控件模板?我想看看给定的控件是如何构造的,以便我可以正确自定义行为和/或选择使用样式......
Is there documentation/utility that shows the default control template of a given control? I'd like to see how a given control is constructed so I can customize the behavior correctly and/or choose to use a style instead...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这里有一个数字 链接 演示了如何执行此操作。
我还会查看 Kaxaml,它附带了一些名为“简单样式”的代码片段。 这些是所有控件的模板,它们不像默认行为那么复杂,有时可能有点深奥。
Here are a number of links that demonstrate doing this.
I would also check out Kaxaml, which comes with some code snippets called Simple Styles. These are templates for all of the controls that are not quite as complex as the default behavior, which can be a bit esoteric at times.
在我看来,您想尝试 StyleSnooper。它可以加载程序集并向您显示定义每个控件的
ControlTemplate
的有效 XAML。http://dotnet-gui.com/blogs/wpf_tools_blog/WindowsLiveWriter/ StyleSnooperDenStandardStylesaufderSpur_F211/image_2.png
二进制版本和源版本均可用。这个工具是您的 WPF 工具库中非常有用的工具。
It sounds to me that you want to try StyleSnooper. It can load an assembly and show you the effective XAML that defines each control's
ControlTemplate
.http://dotnet-gui.com/blogs/wpf_tools_blog/WindowsLiveWriter/StyleSnooperDenStandardStylesaufderSpur_F211/image_2.png
Both binary and source versions are available. This tool is a really great one to have in your WPF arsenal.