Data Binding is in the Application ProgramEstablish a connection between the UI and the business logic. If the binding has correct settings and the data provides correct notifications, the elements bound to the data automatically reflect the changes when the value of the data changes. Data Binding may also mean that if the external representation of the data in the element changes, the basic data can be automatically updated to reflect the changes.
In WPF, element dependency attributes can be bound to CLR objects (including ADO. Net objects or objects associated with Web Services and web properties) and XML data.
No matter what elements you want to bind, no matter what the characteristics of the data source are, each binding begins to follow the final model shown below:
As shown in, data binding is essentially a bridge between the binding target and the binding source. This figure demonstrates the following basic concepts of WPF Data Binding:
Generally, each binding has four components: bind the target object, target attributes, bind the source, and the path of the value in the binding source to be used. For example, if you want to bind the content of textbox to the name attribute of the employee object, the target object is Textbox, the target attribute is text, and the value to be used is name, the source object is the employee object.
The target attribute must be a dependency attribute. Most uielement attributes are dependency attributes, and most dependency attributes (except read-only attributes) support data binding by default. (Only the dependencyobject type can define the dependency attributes. All uielements are derived from dependencyobject .)