O'Reilly logo

Data-Driven Services with Silverlight 2 by John Papa

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required