How to use VisualTreeDebugger

Mar 28, 2013 at 11:14 PM
I want to use VisualTreeDebugger to inspect the XAML at run time. here is what I did:
  1. Installed "Debugging Tools" using "Install-Package WinRTXamlToolkit.Debugging"
  2. Added a reference in my XAML file: "xmlns:debug="WinRTXamlToolkit.Debugging""
  3. Put a hook on a control (a button): "debug:VisualTreeDebugger.BreakOnLoaded="True"".
  4. You can see the XAML at the end
  5. It complains: "The name 'VisualTreeDebugger' does not exist in the namespace "WinRTXamlToolkit.Debugging".
What am I missing?

Thank you,



<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
        <RowDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
    <Button Name="Button1" Content="Button 1" Click="Button1_Click" Grid.Row="0" Grid.Column="0" debug:VisualTreeDebugger.BreakOnLoaded="True" />
    <TextBlock Name="TextBlock1" Grid.Row="0" Grid.Column="1" >I am a text block.</TextBlock>
Mar 28, 2013 at 11:17 PM
I think this is a bug in the Visual Studio designer tool and even though the error shows up in the errors panel - it should still build and run. Also - I recommend using XAML Spy if this doesn't work out. It's a great tool and has a free trial IIRC.
Mar 28, 2013 at 11:23 PM
Actually it does not build. There are three errors in Error List
Error 1 The name "VisualTreeDebugger" does not exist in the namespace "WinRTXamlToolkit.Debugging". c:...\App3\MainPage.xaml 19 102 App3
Error 2 The attachable property 'BreakOnLoaded' was not found in type 'VisualTreeDebugger'. c:...\App3\MainPage.xaml 19 102 App3
Error 3 Unknown attachable member 'VisualTreeDebugger.BreakOnLoaded' on element 'Button' c:...\App3\MainPage.xaml 19 102 App3
Mar 28, 2013 at 11:27 PM
That's strange. I'll need to check it when I have a moment. Perhaps it was built in Release solution configuration. It is configured to only show up in Debug. For now you can simply grab the class from the source code and plop it in your code instead of using the NuGet package.

Here's the link:
Mar 28, 2013 at 11:32 PM
I've built Debug
Apr 2, 2013 at 4:09 AM
Hmmm, I am definitely missing something. I’ve added that class into my project with the same result. I’ve added all the Toolkit projects to my solution with the same result.
Do I need to set anything else on my project?

Thank you,

Apr 7, 2013 at 10:21 PM

I am stuck with this issue I am having? Don't know why it doesn't work for me. Can anyone help please?

Thank you,

Apr 7, 2013 at 10:41 PM
Can you share a sample project where it doesn't work?
Apr 7, 2013 at 11:13 PM
I prepared a project but I cannot figure out how to attach a .zip file to the thread.
Apr 11, 2013 at 1:24 AM
Could you please help me sharing the sample project? How do I attach it to the thread? Or there is a different way to share it?