views:

173

answers:

2

Ok, so I just wasted an hour hunting why my lookless WPF control wasn't showing up in the Window.

Eventually, i traced it to the fact that I forgot to add the ResourceDictionary entry in the generic.xaml file under the themes directory. The style and the class itself was OK.

Is there a way to trace what is going on inside WPF? How to trace how a style gets loaded (or NOT loaded). I imagine that must become a huge stack of stuff to look at, but there has got to be better than having to check each and every file for typos or stuff i forgot.

(I've searched for other questions but there's mostly for a specific case)

Thanks!

+3  A: 

This may not help with your particular problem, but Snoop is a great tool for debugging WPF applications.

This is also a bit unrelated to the issue you mentioned, but I've also found that you need to keep an eye on memory usage when working with WPF (especially when you're getting started), since it's pretty easy to keep unintended references to objects. Red Gate's memory profiler is an amazing tool for this.

IV
Here is a better version of Snoop. Fixes property editing, adds 64-bit support and other impovements...http://www.cplotts.com/2009/12/08/snoop-now-with-64-bit-support-and-more/
John Myczek