The VisualTreeDebugger class from the WinRT XAML Toolkit is what you can use if you want a free tool. It's not as much as XAML Spy, but you get what you pay for. I was thinking about adding additional features to it, such as actual visualization of what you are debugging, but the required work would not justify the investment time +, I did not want to step on Koen Zwikstra turf. I am sure that he is doing a great job with this tool. In any case, VisualTreeDebugger is enough for me, so maybe you will be enough too.
The way you can use this is to add a class to your code, add a link to your XAML, for example
xmlns:debug="WinRTXamlToolkit.Debugging"
then put the hook on the control where you want to start debugging, for example
debug:VisualTreeDebugger.BreakOnLoaded="True"
which will unload the main data of the visual tree as text in the debugger output window (Ctrl + W, O) and break the code that dumped your tree, where you can examine the variable "path", which contains a list of all the visual elements of the tree from the debugged control to the root, so you can observe their values if what you need was not unloaded in the output window.
Other options include
debug:VisualTreeDebugger.BreakOnTap="True" debug:VisualTreeDebugger.BreakOnLayoutUpdated="True" debug:VisualTreeDebugger.BreakOnLoaded="True" debug:VisualTreeDebugger.TraceOnTap="True" debug:VisualTreeDebugger.TraceOnLayoutUpdated="True" debug:VisualTreeDebugger.TraceOnLoaded="True"
Since this is source code and a really simple simple class, you can easily add extra things to the code to do any custom debugging.
Filip skakun
source share