WPFwiki, wpf, wiki, .net 3.0, windows presentation foundation, FAQ, free resources, solution, development, microsoft Home of the world's largest WPF FAQ
Edit

Category

Data Binding

Edit

Question

What's the difference between the Binding and BindingExpression classes?

Edit

Answer

The Binding class is used to declare the link between a target and a source (see related links). It describes the way the information is passed between the two. It is the abstraction behind an actual binding between two objects.

On the other hand, BindingExpression is the actual binding. One Binding declaration will spawn one or more BindingExpression objects, each one independent (no sharing) from the others. BindingExpression is more an internal class that rarely needs to be accessed.

For example, consider a Binding declared between a ListBox ItemTemplate and the elements of a collection. The Binding describes the link between the ItemTemplate's sub-control property and the collection element's property. The BindingExpression will be an object linking a particular ListBox's item and its associated collection element. There will be a different BindingExpression instance for each element of the collection

Edit

Related Links

Binding Source vs. Binding Target

All content is Copyright ©2007 Xceed Software Inc. unless otherwise indicated. See the Terms of Service. Contributors must read and agree to the Contribution Policy. WPFwiki is brought to you by Xceed, makers of the powerful yet free Xceed DataGrid for WPF.