Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What do binding Error codes mean, and where can I find a list of them?

Tags:

binding

wpf

When I get a binding error in WPF, there is an error code that goes with it.

For example,

System.Windows.Data Error: 40 : BindingExpression path error: 'Product' property not found on 'object' ''ProductModel' (HashCode=57788087)'. BindingExpression:Path=Product; DataItem='ProductModel' (HashCode=57788087); target element is 'TextBox' (Name=''); target property is 'Text' (type 'String')

or

System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'MenuItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')

What do these error codes represent, and where can I find a list of them?

like image 663
Rachel Avatar asked Jan 26 '13 03:01

Rachel


People also ask

What is bind error?

The explain_bind function is used to obtain an explanation of an error returned by the bind(2) system call. The least the message will contain is the value of strerror(errno), but usually it will do much better, and indicate the underlying cause in more detail.

What is the purpose of error codes?

Error codes can also be used to specify an error, to simplify research into the cause and how to fix it. This is commonly used in consumer products when something goes wrong, such as the cause of a Blue Screen of Death, to make it easier to pinpoint the exact problem the product is having.

Could not use view or function because of binding errors in SQL Server?

when deploying changes to our systems it is not uncommon to get this error message Could not use view or function because of binding errors. This happens because a view can become outdated because of changes to the underlying objects upon which the view depends.


1 Answers

I don't think you'll find an official source documentation anywhere, these appear to be messages and codes internal to WPF assemblies.

This won't be the single place to find all the possible errors but if you look at the source, you could look at the MS.Internal.TraceData class and you'll find your error messages and codes there. It looks like it was refactored since this answer was posted but you can find these in the generated AvTraceMessages.cs file.

For instance, TraceData.ClrReplaceItem() corresponds to error 40 and TraceData.NoSource() corresponds to error 4.

Fortunately we now have access to the resource file that was used to generate these messages which you can find here. It looks like the error codes might correspond to the index within this file.

like image 122
Jeff Mercado Avatar answered Nov 15 '22 10:11

Jeff Mercado