Chapter I: Introducing Silverlight

Posted by Apress Free Book | Silverlight December 04, 2008
Tags: silverlight
If you are already a .NET developer, you will be in familiar territory after learning XAML and its features. The correspondence of XAML to classes in .NET is a major strength, and the tool support built around XAML for designers and developers is strong and growing.

The History of Silverlight

Before the MIX conference in March 2007, Silverlight was known by the relatively boring but descriptive name WPF/E, which stands for Windows Presentation Foundation/Everywhere. While the details were sparse at the time, the rough goal of the technology was clear: a browserhosted version of WPF. Silverlight 1.0 was unveiled at the conference and would no longer be known as WPF/E. This initial release of Silverlight did not have a CLR or anywhere close to the capabilities provided by 2.0. What it did have, though, is support for a small subset of XAML and a variety of capabilities that foreshadowed the future of Silverlight. Possibly the most obvious aspect of Silverlight 1.0 is that applications are written either completely in XAML or in a mix of XAML and JavaScript. Since there is no CLR, there is no compilation step, and the JavaScript is interpreted on the client. The major features supported by Silverlight 1.0 are

  • Core architecture: This includes DependencyObject at the root, and UIElement forming the base of user interface classes (but no FrameworkElement class).
  • Basic layout: The Canvas is the only layout component, so user interface elements can only be placed using absolute positions.
  • Basic controls: The TextBlock and Run controls are provided to display text. In terms of handling user input, nothing specialized is provided. This limitation extended to Silverlight 1, and the full control architecture debuted when Silverlight 2.0 was first released in beta.
  • 2D graphics: Geometry-based classes (which are flexible but can't be directly placed on a user interface) and Shape-based classes (which can be directly placed on a user interface) provide the ability to draw 2D shapes.
  • Media: Many early Silverlight applications showcased the image and video support provided by Silverlight. Also included is support for easily downloading media such as images so that bandwidth could be utilized more effectively.
  • Animation: The Storyboard class known from WPF became part of the XAML implementation in this first release of Silverlight, providing the ability to animate different user interface elements in a variety of ways.
  • Brushes and transforms: Brushes such as the image brush, video brush, and color brushes (solid colors and gradients) have been in Silverlight since this initial release.
Silverlight 1.0 does require a plug-in on the client side, and in the spirit of Microsoft's commitment to backward compatibility, Silverlight 1.0 applications still work on Silverlight 2.0. Two of the most important parts of the latest release of Silverlight that are not present in Silverlight 1.0 are a rich set of controls and performance advantages due to compiled code.

Soon after Silverlight 1.0 was released, the next version of Silverlight was released in preview form. This preview release was known as Silverlight 1.1, the most significant aspect of which is the cross-platform CLR. While Silverlight 1.0 could be used to develop some impressive media-based applications, the possibilities greatly expand with the ability to target the .NET platform and know that the application will run on multiple host platforms. The biggest missing feature from Silverlight 1.1 was a set of standard controls. This made developing useful user interfaces difficult. Handling input events was also difficult since events could only be captured on the root container. You then had to manually propagate the events to child objects. Input focus was also tricky.

After several months, as it got closer to the MIX08 conference in March 2007, Microsoft revealed that Silverlight 1.1 would actually be released as Silverlight 2.0 since the feature set grew so much. Fortunately, the 2.0 release of Silverlight includes a standard control set (probably everything you would want except for a tree control and a combo box control) and an input event system that saves Silverlight developers the tedium of handling input events manually. Silverlight 2.0 comes with much more than just these important additions. We get strong networking support, even including the ability to communicate over sockets. We get the System.Xml classes, though they are a subset of the same classes in the .NET Framework on Windows. We get the ability to develop in any .NET language we want-including dynamic languages such as compiled JavaScript and IronPython. This book will cover Silverlight 2.0 in detail and help you quickly get up to speed on this new technology.

Total Pages : 6 12345