开发者

What are the tools available for troubleshooting WPF and Silverlight Databinding issues?

开发者 https://www.devze.com 2023-01-22 18:50 出处:网络
开发者_运维技巧In general, what are the best practices to debug a Silverlight or WPF application, especially when you get errors with Databinding? Are there free tools available? I am not getting any
开发者_运维技巧

In general, what are the best practices to debug a Silverlight or WPF application, especially when you get errors with Databinding? Are there free tools available? I am not getting any errors as such, but I am interested in figuring out the approaches that you take as Silverlight and WPF experts.

Thanks!


In Visual Studio, go into
Tools - Options - Debugging - Output Window, and set "Data Binding" to "All".
This is what I use all the time when my Bindings don't work as they're supposed to :)

From the Output window you can then see the hashcode (and alot of other information) of the binding that failed, and then you can use GetHashCode() on any DependencyObject to find the object that's failing (since you likely know where to look this doesn't take to much time).

Also checking the input values of Converters are a great way to go.


Bea Stollnitz has an excellent post on her blog: How can I debug WPF bindings? I've only needed to use her idea of a debug ValueConverter once, but it made a huge difference.


Visual Studio's Debug window shows you any binding errors it encounters, and I've also used Snoop for figuring out UI problems before

0

精彩评论

暂无评论...
验证码 换一张
取 消