Data points: Using Silverlight 2 and WCF to build service-driven applications

Source: Internet
Author: User
Tags representational state transfer silverlight

This column is based on the Beta 2 version of Silverlight 2. All the information in this article may be changed.


Sample Application

Cross-domain communication

Silverlight Client

Binding Product List

Asynchronous communication

Product details and binding mode

Change Event


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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.