是否有与DOM资源管理器等效的WPF? [英] Is there a WPF equivalent to a DOM explorer?

查看:56
本文介绍了是否有与DOM资源管理器等效的WPF?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用CSS在网页上绘制布局时,可能会有数十条规则散布在数十个文件中,这可能会影响元素的实际显示方式.这就是为什么DOM资源管理器如此重要的原因-我可以在浏览器上选择一个元素,然后准确查看要对其应用哪些CSS规则.

When I'm drawing a layout on a webpage, using CSS, there can be dozens of rules, scattered across dozens of files, that could possibly influence how an element is actually displayed. Which is why the DOM explorers are such critical tools - I can select an element on a browser and see exactly what CSS rules are being applied to it.

在WPF中,可能还会有很多规则-样式和模板以及从代码背后注入的内联属性和设置-可能会相互作用以确定给定元素的显示方式.

In WPF, there can again be many rules - styles and templates and inline attributes and settings injected from the code-behind - that could possibly be interacting to determine how a given element is displayed.

我有没有办法查看一个元素,例如ComboBox,并快速准确地确定为什么它绘制的高度是我认为的三倍?

Is there a way for me to look at an element, say a ComboBox, and to quickly determine exactly why it is drawing three times as tall as I think it should?

推荐答案

  • 监听-WPF间谍实用程序
  • Mole-具有属性编辑功能的可视化器
  • 我个人使用Snoop.我不熟悉Mole,但听说它不是免费的",但它更好"(主观).不过,使用Snoop有一个技巧,如果创建的窗口不是主窗口,则可以通过执行Ctrl + Shift + MouseOver(实际上以当前的可视控件为目标)来将其作为目标.这花了我一段时间才知道,并且知道这非常有用!

    Personally, I use Snoop. I'm not familiar with Mole, but I heard it is "better" (subjective), though it isn't free. There is a trick to working with Snoop though, if you have a window created that isn't the main window, you can target it by doing a Ctrl+Shift+MouseOver (that actually targets the current visual control). This took me awhile to figure out, and knowing that is super useful!

    这篇关于是否有与DOM资源管理器等效的WPF?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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