Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to inspect a tooltip using Live Visual Tree?

Visual Studio's Live Visual Tree is great for inspecting UI elements. But how can I inspect a tooltip in my application?

I turn on "Enable Selection" in the mini-toolbar that appears that the top of my WPF application's window, but with that turned on, tooltips no longer appear.

If you make the tooltip visible first, it will disappear when you move the mouse to the mini-toolbar.

So this is a Catch-22. Any thoughts appreciated.

like image 726
Ivan Pelly Avatar asked Oct 17 '25 07:10

Ivan Pelly


2 Answers

Live Visual Tree is a new feature in Visual Studio 2015, I'd say they are very late in catching up for giving tools for WPF Developers.

Please send a bug in Microsoft Connect.

I would recommend to look at Snoop The WPF Spy Utility. It will give you the ability to inspect the tooltip and it's well tested working tool.

like image 175
123 456 789 0 Avatar answered Oct 20 '25 01:10

123 456 789 0


I agree with the Snoop recommendation.

If you are new to Snoop, I would add that a valuable hidden feature is to hold down Shift+Ctrl as you hover over your app. This will allow your Snoop window to zero in on the exact element quickly, without the need to manually navigate your visual tree.

You will actually want to snoop the element that has the ToolTip property set, not the ToolTip itself. For example, if the ToolTip is on a TextBlock, simply navigate the Tree on the left (or use the Shift+Ctrl tip) to that particular TextBlock. The ToolTip itself does not need to be showing on the screen. Then on the right side in the Properties Tab, you can filter down to the ToolTip property. If the ToolTip property happens to have a binding, you can see the binding from Snoop as well.

like image 36
Tim Oehler Avatar answered Oct 20 '25 01:10

Tim Oehler



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!