Moling WPF

Moling WPF

Mole 2010 and Mole 2012 are Visual Studio debugger visualizers that enable you to drill into and analyze any program which targets the .NET Framework 3.5 or above (except Silverlight, Metro and Windows Phone). It runs inside Visual Studio while you are debugging. Mole has extra features that make it even easier to debug applications written on certain platforms, such as the Windows Presentation Framework (WPF). In addition to all of the core capabilities in Mole, WPF developers can also leverage the following features.

UI Element Hierarchy

The Element Tree tool displays UI elements that make up your WPF user interfaces. It will display the standard WPF controls, and all third-party controls that you use in your applications. The selected element’s properties are displayed in the MoloScope area. Use the search box to quickly find the UI elements you’re interested in.

You can access convenient features in the context menu; such as setting a new root node in the tree, or copying an element’s ancestor path to the clipboard. For more advanced scenarios Mole also provides a view of a user interface’s logical tree.

UI Element Snapshot

The Snapshot pane shows a visual rendering of the element selected in the Element Tree. The toolbar above the snapshot image allows you to quickly copy the image to the clipboard, change the background color, and determine what triggers the image to update as you explore your application in Mole.

UI Element XAML

The XAML pane displays a markup representation of the element selected in the Element Tree. This is useful when you need to quickly understand the property settings on an element and its children. The XAML text is colorized, making it easier to read. The toolbar above the XAML allows you to change the font size, determine how markup attributes are presented, and determine what triggers the XAML to update as you explore your application in Mole.

Drill Into Data Bindings

WPF user interfaces often rely heavily on data bindings. Mole 2010 allows you drill into these bindings to inspect their property settings. When exploring a WPF application the MoloScope has a Binding column, as seen below:
After you click on the Drill icon you can examine the BindingExpression and Binding objects that are applied to the property.

Additional Dependency Property Information

As seen in the screenshots above, Mole optionally displays attached dependency properties, such as Grid.Row and Grid.Column, in the MoloScope. It also will show the value source of all dependency properties it encounters on UI elements, which can be useful when tracking down why a dependency property has a certain value. If a dependency property is animated or coerced, an indicator will appear in the Source column to inform you. Mole makes dependency properties easier to work with.