Eric Griffin's Blog

Technical Strategist

SilverLight and Visual Studio Orcas First Look - Part I

SilverLight and Visual Studio Orcas First Look - Part I

  • Comments 1

As I have said in my previous post, my interest has peaked in SilverLight because of the tight integration with Visual Studio Orcas. Specifically it allows you to use Managed Code (i.e. C# or VB.NET) to drive XAML UIs.

I promise an in-dept dive into SilverLight during the next week or so, but first I want to kick the tires, and make a couple of observations before I jump in. Being a consultant, I have scars showing that making assumptions can be a bad thing. So I won't assume what you know or don't know.

The first thing I notice is the tight integration between Expression Blend (May Preview) and Visual Studio Orcas.

Here are a frew screenshots from Blend.

 

 

 

 

 

 

 

 

 

As you can see you've got four choices:

The WPF (Windows Presentation Foundation) and SilverLight Application Options are is a .NET integrated projects. I'm not interested in WPF Control Librarys or SilverLight Javascript applications so I am skipping over those.

Although WPF and SIlverlight are similar (they both use XAML as the UI markup), they are fundamentally different.

WPF XAML UI markup - Window

<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="WPFApp1.Window1"
    x:Name="Window"
    Title="Window1"
    Width="640" Height="480">

    <Grid x:Name="LayoutRoot"/>
</Window>

SilverLight XAML UI markup - Canvas

<Canvas
    xmlns="http://schemas.microsoft.com/client/2007"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:UntitledProject5="clr-namespace:UntitledProject5;assembly=ClientBin/UntitledProject5.dll"
    x:Class="UntitledProject5.Page;assembly=ClientBin/UntitledProject5.dll"
    Width="640" Height="480"
    Background="White"
    >
</Canvas>

So now we know a little more about how WPF and Silverlight use XAML. 

I am more interested in SilverLight Applications so let's look at the Expression Blend Project Window.

You can see right off that Expression Blend Projects are Visual Studio projects. In this case I preferred C#.

The "References" folder shows .NET assemblies. Several are similar to pure .NET C# projects. But make no mistake about it. These assemblies are purely SilverLight assemblies. They are not shared with the .NET 3.x assemblies. So the "System.Xml.Core" you see is not the same one as "System.Xml" you will find in a non-SilverLight Visual Studio.NET Application.

There is a HTML page (Default.html) to host the display of the SilverLight code with a supporting Default.html.js. Double clicking the HTML page opens the page in your default editor. In my case that is Expression Web. Koolness.

Page.xaml is the SilverLight UI markup that I mentioned above. As you can see  the Pag.zaml.cs that is the C# code behind. Double clicking on it takes you to Visual Studio. Nice.

Lastly, you can see Silverlight.js, this is the SilverLight runtime that is hooked into the HTML page.

In part II I am going to look into Visual Studio SilverLight projects and into SilverLight Architecture. Stay tuned.

AddThis Feed Button
Leave a Comment
  • Please add 3 and 8 and type the answer here:
  • Post