1. Home
  2. Computing & Technology
  3. C / C++ / C#
photo of David Bolton
David's C / C++ / C# Blog

By David Bolton, About.com Guide to C / C++ / C#

Silverlight 2.0 is Go!

Tuesday October 14, 2008
You might find the Silverlight.net website a little busy today as everyone and their dog is downloading Silverlight Version 2.0 onto Windows and Mac computers. No mention of the Linux version though that is promised as a spin-off of Mono called Moonlight.

Version 2.0 is the long awaited release that lets you create Rich Internet Applications in C# (and several other languages including Iron Python, IronRuby, Managed JScript and VB.NET ) that runs in a browser, not just in Internet Explorer but Firefox, and Safari. Silverlight includes support for HTTP over TCP which means that you can connect to WCF, SOAP, or ASP.NET AJAX services and receive XML, JSON, or RSS data.

Installation is a small download and then you are away. It's similar to Flash with the big difference that developing for Silverlight is a lot easier than for Flash. You create controls in XAML, an XML based declarative language that looks like this:

<Button Height="25" Width="100" Grid.Column="0" Grid.Row="0" Click="Button_Click"/>
<Rectangle x:Name="rect1" Fill="Red" Width="150" Height="100" Grid.Column="1" Grid.Row="1"/>

Then you write code in a code-behind file (just as in ASP.NET) like this

private void Button_Click(object sender, RoutedEventArgs e)
{
    rect1.Fill = new SolidColorBrush(Colors.Blue) ;
}
and that's a red square and button. Click the button and the square turns blue. Where it becomes more Flash like is that you can create animations, audio, and video. Also, a DataGrid and Listbox can be bound to a database and display data. WPF Controls that come as standard in Silverlight include Button, Calendar, CheckBox, DataGrid, DatePicker, HyperlinkButton, ListBox, RadioButton, and ScrollViewer.

This is a major step forward in developing applications for interacting with the web but I think at least one influential group will not be so happy with it. Not Adobe as you'd expect (Silverlight is a competitor to Flash/Flex) but W3C (the Web organization) because viewing the source of websites will become much harder.

Comments

No comments yet. Leave a Comment

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

Explore C / C++ / C#
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. C / C++ / C#

©2009 About.com, a part of The New York Times Company.

All rights reserved.