Wednesday, July 30, 2008

My version of Snoop (+ 2 features) of WPF


I think that every WPF developer knows that is Snoop. This is helpful tool (with source code (!!) ) for visual debugging of WPF's app at runtime. It is good but I was in need of some expansions.
  1. I needed to see Template of controls in visual tree.
  2. I needed to keep a/some couple (value and property) of control in visual tree.
I implemented this issues for self purpose and want to impart this to all.

At first. My coworker Ivan and ex-coworker Eugene implemented like issue. But their solution didn't satisfy me. It had low performance. I re-implement it and in my solution convert to xaml come true after click to "Show XAML!" button only. It increase performance in comparison with previous solutions.


For second feature I used code of Beatriz Costa that allows you to drag and drop items between data bound ItemsControls (I added a little modification for my purpose only). I added new PropertyGrid. We can drag a item from main PropertyGrid to keep PropertyGrid.

In last PropertyGrid property saves relation with its owner even if it contains different owners of properties.

Here you can find the project with this features built using VS2008.

Enjoy ;)