#25 – Data Binding Overview
August 6, 2010 3 Comments
Data binding is a core feature in WPF. In a typical application, there is a presentation layer that contains the visual controls allowing a user to interact with the application and its data. Below the presentation layer is typically a business layer, which contains the CLR objects that contain the actual data. (There may also be a lower data layer where the data is persisted, e.g. a database).
As a user works with an application, there is an expectation that:
- When data in the CLR objects changes, the changes are reflected in the GUI
- When a user changes data via the GUI, the changes are replicated in the CLR objects
The data binding model in WPF automates this relationship by binding properties of a CLR object to user interface controls through a Binding object.