30

As a “hardcore” WinForms programmer from a Win32 background I have always used Spy++ to understand what my applications are doing at the UI level including:

  • Seeing what events the controls are sending to each other.
  • Seeing the control tree at run time
  • Finding the control that is drawing part of the display

I then often search for the control name in the source code, very useful when you have to change the UI on a large application you don’t know well.

So how do I do the same with a WPF application?

(You may assume I have access to the source code of the WPF application if needed, however I rather the utility worked without the need for the applications source code.)


Thanks for the answers, I have just searched for “Snoop” in StackOverflow and found a few questions/answers with lists of WPF tools.

Community
  • 1
  • 1
Ian Ringrose
  • 51,220
  • 55
  • 213
  • 317

2 Answers2

29

Yes, you can use Snoop. It is exactly like Spy++ for WPF.

alt text

Lennart
  • 9,657
  • 16
  • 68
  • 84
japf
  • 6,598
  • 3
  • 33
  • 30
  • ++ Snoop's my favourite too. There's others, but they aren't as good as snoop. If you're programming silverlight then there's Silverlight Spy: http://silverlightspy.com/silverlightspy/download-silverlight-spy/ – Rob Fonseca-Ensor Nov 04 '09 at 10:05
  • Snoop is totally awesome. +1 I also want to point anyone who looks at this question/answer to effort I've done with Snoop at http://snoopwpf.codeplex.com. I have added interop support, 64-bit support, WPF 4.0 support and more. See my blog for more info too: http://www.cplotts.com/2009/12/08/snoop-now-with-64-bit-support-and-more/ – cplotts Apr 01 '10 at 19:22
5

Note: Present post is based on Web Archive, and the original page is not currently available as of 2018/07/12!

I prefer Snoop, but also wanted to point out Mole, which is a Visual Studio debugger visualizer for WPF elements:

enter image description here

T.Todua
  • 53,146
  • 19
  • 236
  • 237
Kent Boogaart
  • 175,602
  • 35
  • 392
  • 393
  • 2
    I use Mole. But it doesn't work if you debug a partial trust app (XBAP for example), you have to switch to full trust... – Massimiliano Apr 01 '10 at 19:20
  • Someone made it on [GitHub](https://github.com/Oceanware/Mole-Visualizer-For-VS-2019), but source is not open, so i don't like that fact. – T.Todua Jul 20 '20 at 13:28