Do you like WPF Inspector?
You can now support my work with a donation.
WPF Inspector is a utility that attaches to a running WPF application to troubleshoot common problems with layouting, databinding or styling. WPF Inspector allows you to explore a live view of the logical- and visual tree, read and edit property values of
elements, watch the data context, debug triggers, trace styles and much more.
A quick Roadmap
Before Version, 1.0 I plan to do the following:
- Add a collapsible panel to the rules view (including disabling of rules)
- Add support for storyboards, EnterActions and ExitActions
- Finish the implementation of the binding editor
- Improve synchronization between logical and visual tree
- Add better visualizers for resource entries (e.g. styles
- Add more editors for special data types in the property grid
- Online Update Mechanism (Notify when an update is available and automatically download the new version)
Ideas for future versions:
- Add support for silverlight (the SilverlightInspector :-)
- Refactor the whole app to have a client view and a remote agent
- Add plugin support (provide a data model and a public API)
- Add a UIAutomation view (like in Spy++)
- Allow some manipulations in the tree (remove items, reorder, evt. add)
- And a lot more...
Attaching to a running application
When WPF Inspector is launched, you see a list of running WPF applications. Doubleclick one or select and press "Attach" to start the inspection.
Inspecting the visual and logical tree
After attaching to the application, the inspector window is opened. It shows the elements of either the visual or logical tree. By selecting one, you can see and edit all properties of the elements.
Hovering over the application while pressing the CTRL key automatically selects the element that is below the cursor. By pressing CTRL+SHIFT you can also select parts of the control template.
Major parts of the view are marked bold. The number next to the element shows the number of descendants. When hovering over an element in the tree, a tooltip shows the visual representation of the element.
View and edit Properties
WPF Inspector provides a mature property grid that includes editors for all common data types including a search. The square behind the property shows the source of the value. If the value is databound, a yellow border is shown and you can see the binding
expression. Modified values are highlighted by a blue background for a few seconds. You can also set breakpoints to any property that breaks into the debugger, when the value changes.
See the DataContext
Another useful functionality is to see the content of the DataContext. This is very helpful to search for problems in bindings. The property grid updates live and allows expansion of complex types.
Triggers are very powerful, but they can also be very tricky to debug, since they are part of WPF, so there is no chance to set a breakpoint and see the values. WPF Inspector provides the very unique functionality to live see the values and conditions of
Styles are often inherited multiple times. So it's hard to know which setter finally affects the value. The style tracer of WPF Inspector easily shows the inheritance of styles and the overwritten values.
Another useful feature of the WPF Inspector is the resource explorer. It lists up all resources that are visible for the currently selected element. They can be either local, inherited or theme resources.
Checks for Performance, Maintainability and Stability
Finally WPF Inspector includes a set of rules for performance, maintainability and stability of a WPF application. These rules are continously monitored while the inspector is running. Violations are shown as informations, warnings or errors on the bottom
of the window.