Property name in Bindings case insensitive?

I was debugging a piece of code, and, to my surprise, the following lines worked correctly.

Binding binding = new Binding("Text", myObject, "PropertyName");

Binding binding = new Binding("Text", myObject, "propertyname");

The property name seems to be case insensitive, but I can't find anything about it.

Can someone tell me if I missed something, or what could be rational behind it?

+4
source share
1 answer

I do not know where it is documented, but it really is in the source .

It uses StringComparison.OrdinalIgnoreCaseto compare the name of the property from the binding with the actual property of the object:

if( tempPropInfo==null
    &&
    String.Equals (propInfos[i].Name, propertyName, StringComparison.OrdinalIgnoreCase)
  )
  {
  }
+5
source

All Articles