Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Capturing WPF Runtime BindingExpression errors

We can all see Runtime BindingExpression errors in the Visual Studio Output Window. But can we capture these events in the running app itself? I'm hearing about WPF tracing... does this have something to do with this facility? Also, the System.Windows.Data namespace contains no documented events (like a BindingExpression error event), why?

like image 232
rasx Avatar asked Mar 30 '26 18:03

rasx


2 Answers

The answer to your first question is "not really."

[There was a blog post from 2009 that went more into the details of debugging this situation, but it no longer exists and so the link has been removed from this answer.]

like image 71
exclsr Avatar answered Apr 02 '26 09:04

exclsr


Actually, that is not exactly true. Yes the binding logic is dynamic, and its in its own pipeline that is hard to follow. BUT, I found this great blog entry from Jason Bock.

http://www.jasonbock.net/jb/Default.aspx?blog=entry.0f221e047de740ee90722b248933a28d

TL;DR: Jason has a class that can provide the method of capturing any binding errors as an event.

like image 22
Nathan Tregillus Avatar answered Apr 02 '26 11:04

Nathan Tregillus



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!