This column is based on the Beta 2 version of Silverlight 2. All the information in this article may be changed.
Directory
Sample Application
Cross-domain communication
Silverlight Client
Binding Product List
Asynchronous communication
Product details and binding mode
Change Event
Conclusion
Without a doubt, silverlight™2 makes it easy to build rich Internet applications (RIA) with a lot of graphics processing technology. On the other hand, it is also an indisputable fact that Silverlight 2 can easily build fairly professional line-of-business (LOB) applications. Silverlight 2 supports a powerful and XAML based data binding subset that is Windows®presentation Foundation (WPF) enabled. The XAML binding markup extension in Silverlight 2 simplifies the process of binding entities to Silverlight controls. Because they are run entirely on the client computer, Silverlight applications are isolated from the entities managed by the server. As a result, service-based communications that are implemented through RSS, representational state transfer (REST), and Windows communication Foundation (WCF) must be available. Fortunately, Silverlight 2 supports interaction with these technologies and other communication pathways, which allows Silverlight applications to interact seamlessly with back-end LOB applications.
I'll show you how to build the Silverlight 2 UI so that it interacts with business entities and databases through communication with WCF. For business logic, entity models, and data mapping code, any presentation layer can use them. I will create a WCF service that will be used by Silverlight 2 applications and establish a server that hosts the WCF service to allow Cross-domain calls. Please note that you can download these samples from the MSDN® magazine website.
Sample Application
Before we start writing code, let's take a closer look at this example. Figure 1 presents a complete application that shows a list of products retrieved from the Northwind database. When a product is selected from the ListBox, the product is bound to the control on the lower part of the page. When a user edits a product through a CheckBox and a TextBox control and clicks the Save button, the product information is sent to the database through WCF. Click the Cancel button to get the latest product list from the server through WCF, while updating the ListBox and its bindings.
Figure 1 Example Silverlight application