Lab 1: Migrating a Windows Forms Application to Silverlight

Silverlight provides a Rich Internet Application (RIA) framework that can be used to build applications that can be deployed through the Web while preserving the rich client-side functionality found in traditional desktop applications created using Windows Forms. This lab is designed to guide Windows Forms developers through the process of migrating applications to Silverlight.

In the lab you'll convert an existing Windows Forms application that consumes data from a Windows Communication Foundation (WCF) service to Silverlight and ensure that existing functionality is preserved. Along the way you'll learn how to create a Silverlight user interface, handle events, make asynchronous calls to services, bind data to controls, plus more.

You'll start by researching existing data access and WCF service projects used by a Windows Forms application. Next, you'll run the Windows Forms application to see the feature set that will be migrated to Silverlight. To accomplish the migration you'll create a new Silverlight project in Visual Studio 2010 and use eXtensible Application Markup Language (XAML) along with managed code (both C# and VB are supported in the lab). The Silverlight application that you'll create is shown next:

Figure 1

Customer application UI

You Will Benefit from this Lab if:

  • You are migrating a Windows Forms application to Silverlight
  • You'd like to create a rich-client application that takes advantage of a web-deployment model
  • You need to integrate distributed data into an application

You Will Learn:

  • How to use the Visual Studio 2010 Silverlight Designer
  • XAML and Silverlight control concepts
  • How WCF services can be integrated into Silverlight applications
  • Silverlight data binding techniques
  • How to make asynchronous calls to services
  • How to work with cross-domain services
  • Similarities between Windows Forms and Silverlight applications

Business Requirements for the Silverlight application include:

  • Create a new Silverlight project and associated ASP.NET Web Application project
  • Re-use existing data access and WCF service code
  • Use XAML to define the user interface and emulate the Windows Forms application
  • Handle user interface events
  • Create a WCF service proxy
  • Call the WCF service using the asynchronous programming model
  • Bind data to controls using Silverlight binding syntax
  • Handle update and delete operations and notify the user about the status of the operation

Estimated Time: 45 minutes