So far in this book, you've learned how to bind your user interface controls to objects so that the user can view and edit data exposed by these objects. Instead of data being pushed into these controls, the extensive data binding support provided by XAML enables controls to pull the data into themselves. In other words, the controls are essentially controlling the process of consuming the data. You've learned that
DataContext
property of a control is inherited down the object hierarchy.OneTime
, OneWay
, and TwoWay
(discussed in Chapter 2). You need to set the mode to TwoWay
to update the bound object property via a control in the user interface.INotifyPropertyChanged
interface, discussed in Chapter 7.IDataErrorInfo
interface, or by implementing the INotifyDataErrorInfo
interface, as discussed in Chapter 7.ObservableCollection<T>
type can be used to maintain items in your collections, which will notify the bound user interface controls when items have been added or removed from the collection so they can update themselves accordingly (discussed in Chapter 6). Alternatively, you can implement the INotifyCollectionChanged
interface in your own collection classes to enable them to exhibit the same behavior.To develop business applications in Silverlight effectively, you need to have a thorough knowledge of the available data binding mechanisms at your disposal. In this chapter, we'll look at some of the advanced data binding features supported by Silverlight, and I'll provide you with tips, tricks, and techniques that you can use to harness the full power of Silverlight's data binding engine.