O'Reilly logo

Microsoft Silverlight 5 Data and Services Cookbook by Kevin Dockx, Gill Cleeren

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

Building a change-aware collection type

Applies to Silverlight 3, 4 and 5

We may not always have the option of binding to a collection that implements the INotifyCollectionChanged interface. For example, what if we have a service that returns IList<T>? Can't we use the automatic synchronization features that Silverlight's data binding engine offers us?

The good news is that we can. For that, we need to build a wrapper class around the IList<T>. This class will implement the necessary interface and will allow data binding to work in the manner in which we are accustomed.

Getting ready

The complete solution for this recipe can be found in the Chapter03/CustomCollections folder in the code bundle available on the Packt website.

How to do it...

For this ...

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