When to use Path in WPF Binding?

There is no functional difference. The default property of the Binding object is Path, this means if you don’t specify which property you are setting then you will set Path.

This is because the Binding object has two constructors, one default and one that takes in a single string parameter. When you pass in a value without labeling it that property will be forwarded onto the matching constructor, in the case of Binding this sets the path. It is very similar in concept to the way attributes work, a call to the constructor followed by optional parameters, for example:

[AttributeUsage(AttributeTargets.Class), AllowMultiple = false, Inherited = false ]

Probably way beyond what you’re actually asking the question for, but I’ve noticed that there is a slight (and probably inconsequential) difference between the two. Since I can’t explain it myself I’ve started a new question about it here.

Leave a Comment