Chapter 2. Silverlight Data-Binding Foundations

Data binding provides a simple way to present and manage data in a Silverlight 2 client application. Data binding handles the process of pushing data from a data source into the target (the Silverlight 2 application’s controls), and in some cases pulling the data from the target back to the source. You can perform this process manually without the data-binding techniques by writing a series of event handlers and manually pushing and pulling data. However, the data-binding techniques are built specifically to help alleviate the redundant code required to handle data binding that goes into each client application. XAML provides a rich set of features for data binding from which Silverlight 2 applications also benefit.

ASP.NET and Windows Forms applications have their own flavor of data-binding controls. For example, ASP.NET has an ObjectDataSource control and Windows Forms has the BindingSource control. The role of these controls is to tie a data source to a series of controls. The data source object feeds the data source, and its property values are presented in controls that tie to the data-binding control. When the values are changed, the binding control sends the values back to the object that is the data source. This model has worked in the sometimes awkward evolution of data binding.

There is no specific data-binding control with Silverlight. Instead, you bake the data-binding functionality right into Silverlight 2 and XAML using ...

Get Data-Driven Services with Silverlight 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.