How This Book Is Organized

Chapter 1 provides some background on some skills needed to read this book. Chapters 2–4 discuss in detail the process of building Silverlight 2 applications as they pertain to data binding. Chapters 5 and 6 demonstrate how to design SOAP applications with ASMX and WCF to communicate with third-party SOAP web services. Chapters 7–9 delve into how to get and manipulate complex data in Silverlight applications using REST and how to build RESTful services. Chapter 10 shows how to communicate with and consume RSS services. Finally, Chapter 11 discusses how to design a Silverlight 2 application that communicates with ADO.NET Data Services. Where relevant, code examples in this book are shown in C# and VB.

Here is a short summary of the chapters in this book and what you’ll find inside (many of the code samples in this book use style resources found in the respective project’s app.xaml file):

Chapter 1, Getting Started with Silverlight 2

This chapter covers the steps to develop applications with Silverlight 2 and explains the various tools and their purposes. It also examines the fundamentals of Silverlight 2, its control set, and the importance of XAML and its data-binding features, and includes a primer on XAML as it pertains to data and Silverlight.

Chapter 2, Silverlight Data-Binding Foundations

This chapter discusses different ways to use data binding with XAML and with .NET code in Silverlight 2. It examines the controls and provides examples on how to bind custom objects to them. It also examines the DataContext property in depth, as well as situations in which you can apply binding through XAML or .NET code.

Chapter 3, Modes and Notifications

This chapter demonstrates situations in which different binding modes can be most beneficial when used with objects and controls. It also explores how to make the Silverlight 2 controls listen for and respond to notifications through INotifyPropertyChanged that can be implemented on objects.

Chapter 4, Managing Lists, Templates, and Converters

This chapter explores various techniques for binding and presenting lists of data in list-based controls. It also discusses how to use templates to stylize and present data more efficiently in controls. Examples use LINQ to Objects to query lists of custom entities, converting bound data between the data source and the target controls, and to implement notifications for list-based collections using INotifyCollectionChanged and ObservableCollection<T>.

Chapter 5, WCF, Web Services, and Cross-Domain Policies

This chapter demonstrates how to communicate between Silverlight 2 applications and WCF services—both custom and from third parties. It demonstrates how to build an application in Silverlight 2 that communicates with web services on different domains using SOAP either through WCF or ASMX web services. Also, it discusses what cross-domain policies are, how to account for them, and how to debug applications using network-sniffing tools.

Chapter 6, Passing Entities via WCF

This chapter shows how to send and retrieve custom domain entities filled from ADO.NET-driven data mappers in the middle tier, and expose them through WCF contracts and serialization techniques. It also shows how to pass entities from tools such as LINQ to SQL and from the ADO.NET Entity Framework to and from Silverlight 2 applications.

Chapter 7, Consuming RESTful Services with WebClient and HttpWebRequest

This chapter discusses how to consume and present data retrieved from REST services and manipulate it using LINQ to XML. It demonstrates how to use WebClient and HttpWebRequest from Silverlight 2 to invoke RESTful communications with web services, and also includes a primer on RESTful services and how Silverlight 2 can communicate with them.

Chapter 8, Consuming Amazon’s RESTful Services with Silverlight 2

This chapter demonstrates how to send and receive data using the RESTful API exposed by the Amazon E-Commerce Service (also known as Amazon Associates Web Service). This case study shows how to build a Silverlight 2 application that allows users to search for and add items to a shopping cart stored at Amazon.

Chapter 9, Creating RESTful Services and Introducing SilverTwit

This chapter discusses how to build a RESTful service with which Silverlight 2 applications can communicate. The services allow GETs and POSTs to be sent from Silverlight 2 applications passing XML and JSON. The chapter also demonstrates LINQ to XML and LINQ to JSON, and includes a case study of the SilverTwit Twitter client to demonstrate how building a RESTful WCF application can be an important component of a Silverlight 2 application.

Chapter 10, Syndication Feeds and Silverlight 2

This chapter explains issues with consuming syndicated feeds from Silverlight 2 applications and how to overcome them. It also demonstrates the SyndicationFeed class and how to use it to build a robust Silverlight 2 application that uses web services to aggregate Atom and RSS feeds.

Chapter 11, Silverlight 2 and ADO.NET Data Services

This chapter demonstrates how ADO.NET Data Services is uniquely qualified to pass data to and from Silverlight 2 applications using REST-style web services. It also shows how ADO.NET Data Services can communicate with and issue LINQ queries against entity data models in a middle tier to save and retrieve data.

Appendix A

This appendix includes enumerations and values specific to ADO.NET Data Services that are helpful when coding with ADO.NET Data Services.

Appendix B

This appendix demonstrates how to use Fiddler2, Firebug, and the Web Development Helper tools to troubleshoot communication problems between Silverlight and web services.

What You Need to Use This Book

Developing the Silverlight 2 applications in this book requires .NET 3.5 Service Pack 1, the Silverlight runtime, the Silverlight SDK, and the Silverlight Tools add-on. This book demonstrates how to design and develop aspects of Silverlight applications using Expression Blend and Visual Studio 2008. Therefore, I recommend that you have these tools installed.

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.