jump to navigation

The advent of Silverlight 2.0 July 30, 2008

Posted by gcorbin in Silverlight.
Tags: , ,

The time has finally come. Now a client-side framework that gives .NET developers the same power and flexibility as Flash has finally arrived. Silverlight 1.0 has introduced this technology to us, but it still required the developer to work with javascript and forced us to remain bound to its limitations. Silverlight 2.0 applications can be entirely written in any of the managed languages. Programming with Javascript is not needed. The framework will handle it for you. The client-side output for Silverlight is all based on the <Object> tag. This means that the source for the client application can appear to be as simple as an HTML file that has nothing but a reference to Silverlight and an <Object> tag. The way this works is that Silverlight 2.0 has introduced a new file type. This is called a ZAP (XAP) file. The zap file is nothing but a zip file with a different name. If you rename it zip, it will open with winzip and all the binary files will be presented. The binary files that are packaged in the zap file are a subset of the WPF framework and whatever assembly that you create for you Silverlight app. The feature set that is available to Silverlight 2.0 is amazing. Any type of Flash application can be built with Silverlight just as well. Goto http://silverlight.net and see all the samples, you’ll be amazed.


Going into the (Silver)Light. April 29, 2008

Posted by gcorbin in ASP.NET, Silverlight.
Tags: , ,

By now everyone has seen Microsoft’s latest web technology, Silverlight. If you haven’t you got to go check it out. Many blogs I’ve seen have compared it to Macromedia Flash. But, I’ve got to tell you that it differences are just as great as its similarities to Flash. I’ve done work in Flash in the past and it is a great technology. But, Silverlight is in position to become new technology to dominate the client-side browser. There are a few reasons for this.


First, the learning curve for Silverlight is much lower for developers that already understand how to use the .Net Framework. Even thou Silverlight 1.0 only supports javascript , the XAML syntax is exactly the same as if you were creating a desktop WPF application. Once Silverlight 2.0 is out, the learning curve will be even less as that version will support managed C#.


Second, the IDE for creating Silverlight applications is Visual Studio. This is the same development tool that many developers use for building other windows applications.


Third, the event model in Silverlight is the same as ASP.NET. Flash uses an event model that is based on a storyboard that repeats on a specified interval. Silverlight has the typical OnLoad, OnClick, etc. In addition, Silverlight does have a storyboard control that you can use if you need the events to all fire as in Flash.


After doing a fare amount of research into Silverlight 1.0, I decided it give it a try. I wanted to see how well, if at all, it could integrate with my existing ASP.NET site. I found that it ties in very easily. For ease of use, I created an ASP.NET Server control that embeds all the client-side JS files and XAML files needed for my Silverlight application. Then all that I needed to do was to drop that server control on my ASP.NET page and set a few parameters.


My Silverlight app is very simple. I decided to make use of the WPF Ink class to create a Silverlight Signature Control. You can check it a live demo and find the source code for it here. One of the nice things about this control is that is demonstrates several things. With this sample you can see to following:


  • Creating an ASP.Net Server control
  • Working with embedded JavaScript resources
  • Embedding XAML for use with Silverlight.
  • Creating a Silverlight application