我有一个ContextMenu
使用 aCompositeCollection
作为它的 ItemsSource。其中一项(绑定集合中的一项,与硬编码相对)的显示方式与其他项不同。
我在 XAML 中没有看到任何明显的原因,所以我想我会使用 Snoop 来查看实际呈现的样式(并找出差异)。但是,每当我激活 Snoop 窗口以查找上下文菜单时,它都会关闭菜单!
有没有办法使用 Snoop(或类似工具)来检查ContextMenu
?
Whenever user performs any action outside of an opened ContextMenu
will get closed. This is default behaviour of the ContextMenu
, But still Snoop
provides all the informations about the ContextMenu
and it's MenuItems
in the VisualTreeView of the Snoop window on Left side. If you want to snoop a specift ContextMenuItem
ContextMenuItem
you want to snoop which shows a Red border. Also the same control will be selected in the Treeview of the Snoop window