9

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!

4

2 回答 2

7

这可能对您的特定问题没有帮助,但Snoop是调试 WPF 应用程序的好工具。

这也与您提到的问题有点无关,但我还发现您在使用 WPF 时需要注意内存使用情况(尤其是在您开始使用时),因为很容易保留无意的引用到对象。 Red Gate 的内存分析器是一个很棒的工具。

于 2010-02-11T14:15:15.633 回答
2

好吧,没有什么比在 Visual Studio 中调试 ac# 代码更复杂的了,但是有几种方法;

http://rrelyea.spaces.live.com/Blog/cns!167AD7A5AB58D5FE!1625.entry http://geekswithblogs.net/lbugnion/archive/2007/03/14/108728.aspx http://blogs.devsource。 com/devlife/content/silverlight/debugging_dynamic_xaml_in_silverlight_1.html

于 2010-02-11T14:26:03.890 回答