Mar 13, 2008

Silverlight 2

Microsoft has officially released Silverlight 2 Beta 1 to the public. There are a few major changes that come with the release of this version. The list below describe my observations so far:
  • XAML. The XAML schema has somewhat changed since the Alpha Refresh of 1.1. As opposed to the Canvas element in 1.1, UI controls are now implemented using a Grid element that encapsulates all children elements within the control. This leads to somewhat of a confusion when dealing with relative positions of children elements. For instance, if in 1.1 an element's position can be specified using Canvas.Left and Canvas.Top, in 2.0 this position is determined via the Margin attribute for that element.

  • Access to children elements. It came as a pleasant surprise that the Silverlight team has really put the effort into making XAML elements easily accessible from the .NET code. While in 1.1 one must use FrameworkElement.FindName API to access any given XAML element, in 2.0 all XAML elements are members of the class and can be directly accessed.

  • Event handlers. The very first observation regarding event handling is that many of the raised events have changed. Aside from noticing the naming, I have not spent much time with this part of Silverlight to notice any major differences in the behavior of these events.

  • Code deployment. Silverlight 2 code is now deployed through the use of an embedded object as opposed to ActiveX instantiation via scripting. This is good in the sence it will make it easier for web developers to play around it and not worry so much about screwing something up in the process. Another interesting part of the deployment process is the inclusion of the System.Windows.Forms.Controls library in the ClientBin folder. In a previous test, a friend and I tried to see if we can load the full System.Xml from the ClientBin, so I wonder if tricks like that can now be played with the CLR.

The last and somewhat important observation is the lack of support for running 1.1 applications into the 2.0 runtime environment. I hope that this move is for the better. :)

No comments: