Wednesday, 17 September 2008

What is Silverlight?

Silverlight can enhance web applications by providing rich interactive experiences for users. Like Adobe Flash, Silverlight can offer interactivity and advanced animations. Provided that the user has installed the required plug-in, the Silverlight content will run within the browser.

Plugins are available for both the Mac and Windows and come in two versions: 1.0 and 2.0.

When a user visits a web page that has Silverlight content for the first time, they are prompted to install the Silverlight plug-in. The Silverlight application specifies the required version. The process is quick and simple, just a couple of clicks and the plug-in is installed. Once the plug-in is installed, that's it! The user will not be required to install it again.

Regardless of version, Silverlight applications exist within web applications and run, for example in a region of a web page.

The UI is described mainly in XAML (Extensible Application Markup Language), although it can also be generated with code at runtime.

XAML supports complex animations which can be achieved without the need to write any code.

The biggest difference between Silverlight versions 1.0 and 2.0 is the programming model. Silverlight 1.0 applications are programmed in Javascript whereas Silverlight 2.0 applications are written in a .NET compliant language such as C# or VB.NET. Silverlight 2.0 can also be programmed with the new dynamic languages such as Python and Ruby.

Silverlight 1.0


Silverlight 1.0 applications are programmed in Javascript and therefore comprise at least one .js file and one or more .XAML files to describe the UI.

These files reside with those of the parent web application. Alternatively they can be hosted for free by the Silverlight Streaming Service to cut down the cost of storage for your web application. I shall examine the Silverlight Streaming Service in a later post.

You will find many examples of Silverlight 1.0 applications here

I think my favourite has to be the Silverlight Piano.

It does what you would imagine it does. You can either click on the keys or figure out what keystrokes press each note.

Look out for the reflection below the piano keys, particularly when you press a note.

Just to get you started, I have worked out the notes for Ode to Joy. Enjoy !


There are plenty of good examples of business applications including media players and interactive marketing applications but I will show them to you another time. The piano couldn't wait.

Silverlight 2.0

Silverlight 2.0 applications require another plug-in. This is to accommodate a version of the .NET Common Language Runtime (CLR). Although this plug-in is backwards compatible and can still execute Javascript for version 1.0 applications, it's strength is to execute CLR code such as C#.

As a result, Silverlight 2.0 are far more powerful than 1.0.

Unlike Silverlight 1.0 where .js files are hosted in addition to all .XAML content, Silverlight 2.0 code will initially be written in code files such as .CS for C#. These must then be compiled into a .DLL. The .DLL is then placed into a special ZIP file with an extension of .XAP (pronounced ZAP!) See what they did there?

This XAP file must be hosted with the parent web application (or Silverlight Streaming Service).

You will find many examples of Silverlight 2.0 applications here

This airline booking example is a good example of a business use. Shame it's only an example, it is better than any flight booking system I have ever seen.


One interesting feature of Silverlight 2.0 is DeepZoom. This allows you to create a 'wall' of images that a user can zoom into and scroll around. For speed, only those graphics in view are download, the remainder is downloaded as and when the user moves around the images.

A good place to see this in action in the Hard Rock cafe Memorabilia page.


It is important to distinguish between designers and developers at this point. It may be that one person alone is responsible for creating the UI and animations and then writing the code. However, in practice it is more likely to be a team effort.

For the designer whose deliverables are the graphical assets, the UI and animations, Expression Studio is the set of tools for them. Expression Studio comprises tools including Expression Design, Expression Blend and Expression Encoder. In a later post I will show how these tools can be used to create rich and compelling applications.

For the developer, the best tool for the job is Visual Studio 2008 is equipped to deal with Silverlight applications whereas Visual Studio 2005 will require a number of extensions before you can get to work. Once again, I will look at programming Silverlight applications in a later post.


In the meantime should you require any training in Silverlight, QA offer the following courses: 

Extending Microsoft SharePoint Solutions with Silverlight 3

Developing Rich Internet Applications Using Microsoft Silverlight 4

Developing Silverlight Applications with Visual Studio 2010 and Expression Blend 4

And finally

Xpertise will have a stand at ReMix in Brighton next week. So if you would like more information about any of our courses please stop by for a chat. We could talk about Silverlight, Visual Studio, Expression Studio or if you prefer, wargaming.

See you soon

Phil Stirpé
"I don't do average!"

No comments:

Post a Comment