Silverlight 5, thy name is 'Windows'
XNA, hardware-accelerated graphics - sounds familiar
What is going on with Silverlight? Microsoft's browser plugin was conceived as a lightweight, cross-platform version of Windows Presentation Foundation (WPF), the .NET application framework for desktop applications introduced in Windows Vista. Silverlight was energetically developed to compete with Adobe's Flash, there was talk of Silverlight on Intel's Moblin Linux, and a Symbian port was produced.
Microsoft then lost confidence in Silverlight as a cross-platform runtime. Cracks appeared in the cross-platform story when version 4.0 appeared with Windows-only COM interop, in order to integrate with Microsoft Office. No effort was made to bring Silverlight to Android, nor to provide any solution for Apple's iOS, in contrast to Adobe with its Flash for Android and native packager for Apple's mobile OS.
At its Professional Developer Conference in late 2010 Microsoft touted HTML5 as the best broad-reach runtime. Bob Muglia, then president of server and tools, stated that "getting a single runtime implementation installed on every potential device is practically impossible. We think HTML will provide the broadest, cross-platform reach across all these devices." Silverlight was now positioned as a runtime for Windows Phone and more broadly for "enabling enterprise application development."
Hardware-accelerated 3D rendering now featured
Silverlight is not dead, though. At the Mix conference in Las Vegas, Nevada, Microsoft released the beta of Silverlight 5. There are also signs Microsoft envisages a bigger role for Silverlight than Muglia's words implied. The company is using it extensively in its own products. It powers the control panel for the Windows Azure portal, and also for Windows Intune and Lync Server 2010. Silverlight also appears in the new System Center management tools. Microsoft also has Visual Studio LightSwitch in beta, for model-driven development of database applications, and its output is Silverlight.
It is possible that these teams just did not get the Silverlight memo in time. Then again, Windows 8 is set to be unveiled at Microsoft's 2011 PDC in September, will run on tablet devices as well as desktops, and is rumoured to feature a new Windows app store. Silverlight apps are well suited to app store delivery, since they are generally self-contained, auto-updating, and sandboxed by default but with an option to run as trusted applications with greater system access. It would not be surprising to see a new role for Silverlight in this context, which may explain why development continues, including new features focused on desktop or "out of browser" usage.
Speculation aside, what do we get in the Silverlight 5 beta? Top of the feature list is hardware-accelerated 3D graphics and H.264 video. Microsoft has ported parts of the game-oriented XNA framework to Silverlight and added a DrawingSurface control for rendering 3D graphics. The beta does not support XNA effects though this is expected in a future update. 3D graphics only run if hardware acceleration is available, and one snag is that if Silverlight is running in the browser, then video drivers using the older XP Display Driver Model are blocked unless the user gives consent.
In API we trust
Next, a Silverlight application can now display multiple windows when running trusted and out of the browser. Additional windows have to be assembled programmatically, but this is not as bad as it seems since you can add a user control to a project, design it in Visual Studio, and add it to a new window at runtime.
Trusted applications also now get full access to the local file system, where previously it was limited to the user's home folders. Another wrinkle is that trusted applications can now run inside the browser, though this is an enterprise feature that requires registry tweaks and the installation of code-signing certificates, so should not compromise security.
Text handling is a long-standing Silverlight weakness, but version 5.0 brings control over character spacing, line spacing, and the ability to flow text content automatically between RichTextBox controls. Improved OpenType font support is meant to be coming soon.
There are also several improvements to data binding that enable richer display of bound objects. You can have style values bound to object properties, and use different data templates for objects according to their type. You can also debug data bindings in XAML, and more XAML debugging features are promised in future.
This beta is by no means complete. Microsoft has promised further features for Silverlight 5, including vector printing, remote control support, the ability to call the Windows API though platform invoke, 64-bit support, and support for WS-Trust web service security.
A single Silverlight 5 out-of-browser app can display multiple floating windows
Silverlight 5 will be better for games and better for enterprise applications, supporting the idea of Silverlight as a new general-purpose runtime for Windows, and one that will work well both for app store downloads and for enterprise deployment. Support for multiple windows brings Silverlight closer to desktop WPF, and when platform invoke arrives there will be few limitations on what a Silverlight application can do with sufficient developer effort. There is no sign as yet of local database support, though Windows Phone is getting SQL Server CE, though this too could be hacked through platform invoke.
Silverlight 5 will still work on the Mac, though Microsoft vice president Scott Guthrie neglected to mention it in the keynote at Mix where he covered Silverlight, while some features are Windows-specific.
It seems, then, that the product is becoming a lightweight runtime mainly for the Windows platform. In that context Silverlight 5 looks a worthwhile though not revolutionary update.
You can download Silverlight 5 beta from here. ®
Sponsored: Becoming a Pragmatic Security Leader