2009-06-17
| Table of Contents: |
| Rate This Article: | Add This Article To: |
( Page 1 of 4 )
When developing Silverlight applications in Visual Studio, writing XAML by hand is error prone and somewhat difficult. That's where Expression Blend comes in to make the task significantly easier.
Working with Silverlight 3 can be a dream come true if you’re a developer who needs to make that Web application look like its desktop counterpart. My previous article on this topic, “A Microsoft Silverlight 3 Primer” (http://www.devsource.com/c/a/Languages/A-Microsoft-Silverlight-3-Primer) showed just how easy Silverlight can be to use. However, it also pointed out one of the ugly facts of writing Silverlight applications: XML Application Markup Language (XAML). Expression Blend is the next step. It helps relieve the stress of writing XAML by hand.
Expression Blend is a great graphics tool, but you can’t replace Visual Studio with it, which is the point of this article. A Silverlight application actually consists of the user interface element and the code behind element. Expression Blend is a great tool for the user interface and Visual Studio is a great tool for the code behind. To get the best possible development environment, you need to combine the two tools.
I’m using Visual Studio 2008 Team System, so you may see some differences in the dialog boxes and menu commands in this article if you’re using a different version. However, the code I provide will work with all versions of Visual Studio 2008, so don’t worry about any small differences you notice.
Starting the Project in Visual Studio
I’ve tried a number of methods for using Expression Blend and Visual Studio together and find that I prefer starting the project in Visual Studio. Depending on how you create applications, you might choose a different course. However, just to see how you can use the two tools together, let’s start by creating a project in Visual Studio. I’m assuming that you have Silverlight and Expression Blend installed on your system (if you need help, check out my previous article). I’m using Visual Studio. The following steps get you started.
Choose File | New | Project in Visual Studio. Visual Studio will display the New Project dialog box.
Select the Silverlight folder in the language of your choice.
Choose the Silverlight Application template.
Type a name for the application (the example uses the descriptive, SilverlightApplication1, default) and click OK. You’ll see a New Silverlight Application dialog box where you must choose the name of a Web project to host the application.
Click OK to accept the default. Visual Studio creates the project for you.
At this point, you have a new project in front of you with the MainPage.xaml file opened. Normally, you’d begin creating your user interface by hand. However, let’s close the MainPage.xaml file and do something easier.
![]() |
|


