One of the most interesting aspects of Silverlight is the fact that it borrows the model WPF uses for rich, client-side user interfaces. WPF is a next-generation technology for creating Windows applications. It was introduced in .NET 3.0 as the successor to Windows Forms. WPF is notable because it not only simplifies development with a powerful set of high-level features, but also increases performance by rendering everything through the DirectX pipeline. To learn about WPF, you can refer to another of my books, Pro WPF in C# 2008: Windows Presentation Foundation with .NET 3.5, Second Edition (Apress, 2008).
Silverlight obviously can’t duplicate the features of WPF, because many of them rely deeply on the capabilities of the operating system, including Windows-specific display drivers and DirectX technology. However, rather than invent an entirely new set of controls and classes for client-side development, Silverlight uses a subset of the WPF model. If you’ve had any experience with WPF, you’ll be surprised to see how closely Silverlight resembles its bigger brother. Here are a few common details:
To define a Silverlight user interface (the collection of elements that makes up a Silverlight content region), you use XAML markup, just as you do with WPF. You can even map data to your display using the same data binding syntax.
Silverlight borrows many of the same basic controls from WPF, along with the same styling system (for standardizing and reusing formatting) and a similar templating mechanism (for changing the appearance of standard controls).
To draw 2D graphics in Silverlight, you use shapes, paths, transforms, geometries, and brushes, all of which closely match their WPF equivalents.
Silverlight provides a declarative animation model that’s based on storyboards and works in the same way as WPF’s animation system.
To show video or play audio files, you use the MediaElement class, as you do in WPF. capabilities of Silverlight by drawing from the full WPF model. In future Silverlight releases, you’re likely to find that Silverlight borrows more and more features from WPF. This trend is already on display with the shift from Silverlight 1.0 to Silverlight 2.0.
In other words, Silverlight is a .NET-based Flash competitor. It aims to compete with Flash today, but provide a path to far more features in the future. Unlike the Flash development model, which is limited in several ways due to the way it’s evolved over the years, Silverlight is a startingfrom-scratch attempt that’s thoroughly based on .NET and WPF, and will therefore allow .NET developers to be far more productive. In many ways, Silverlight is the culmination of two trends: the drive to extend web pages to incorporate more and more rich-client features, and the drive to give the .NET Framework a broader reach.
|
0 comments
Post a Comment