If there's one consistent question I've gotten since Microsoft's BUILD conference back in September, it's a variation of this one: "So, how Silverlight-y is Windows Runtime (WinRT)?" And my answer is typically something like, "Well, WinRT has most of the Silverlight functionality, which gives WinRT great feature parity, but just realize that it's only a portion of the .NET functionality." And I confidently tell folks this because I have talked to numerous engineers and experts in Silverlight who have painstakingly and scrupulously examined the bowels of WinRT, looking for weaknesses, features, and parity with Silverlight.
You see, Silverlight is loved. And I mean Silverlight is universally loved by thousands of developers around the world. If WinRT doesn’t measure up, you better believe we're going to hear all about it. Thankfully, WinRT does measure up to Silverlight's features. Again, just understand that .NET has been a monster since its release a decade ago. So, although WinRT has equivalent functionality to Silverlight, this doesn't mean it has the same parity with ASP.NET or Windows Presentation Foundation (WPF). At least, not now in its developer preview state.
I also say, "Now, we really shouldn't be judging something that isn't even in an alpha, let alone beta, state." Microsoft reserves the right to change anything and everything in Windows 8. When Windows 8 and WinRT make it to the beta stage, we can be pretty confident of its features and power. We're a significant number of months from the beta release of Windows 8's WinRT.
There's one industry pillar that has obsessed on this topic, however: Carl Franklin of .NET Rocks fame. Carl has built a Metro application wiki site, Metroapps, dedicated to the process of converting a Silverlight application to XAML, C#, and VB.NET with the .NET 4.5 WinRT Metro application. I attended Carl's presentation on this topic last week and found his ideas very interesting.
First, Carl pointed out that both Silverlight and WinRT are runtimes that you program with Visual Basic or C#, and you use XAML for the UI. With that information, Carl answered the following simple questions:
- Can I just compile my Silverlight apps as Metro apps? No.
- Can I reuse some of my XAML? Yes.
- Can I reuse most of my non-UI code? Yes.
If you want to cut right to the chase on Carl's site, go to the Delta with Silverlight page where Carl details the differences between System.Windows in Silverlight 4 and the new System.Windows in WinRT in terms of the API. If you scroll to the bottom right of the page, he sums it up for you: 393 of the 756 UI types in Silverlight 4.0 exist with the same name in WinRT, giving it 52 percent pure parity in terms of the API. Carl is quick to point out that he compared type names only and most of the overall functionality is still there, so that number is a bit misleading.
Carl also details significant design differences in WinRT:
- There's no Modal Windows; ChildWindow is gone
- There are missing controls: Calendar, ChildWindow, DataGrid, DataPager, DatePicker, DescriptionViewer, MultiScaleImage, OpenFileDialog, RichTextBox, SaveFileDialog, TabControl, TabItem, TreeView, Validation, WebBrowser
- There are new controls: ApplicationBar, CaptureElement, CarouselPanel, FlipView, GridView, GroupItem, JumpViewer, ListView, MediaPlayer, ProgressRing, RichTextBlock, WebView, WrapGrid
- Many features have been rewritten or missing: Dispatcher, file I/O, reflection, networking/sockets, anything using callbacks (IAsyncResult)
I find the most interesting commentary and information on the Metroapps site from Carl is how Silverlight developers will handle design in this new Metro world. Carl points out that:
- Most developers will start Metro UI from scratch except for core UserControls.
- Silverlight developers will struggle with how to leverage existing Silverlight software assets and still make their apps look like Metro apps.
- Silverlight developers will spend significant time rethinking design in a non-modal world.
I strongly encourage you to go to Carl Franklin's Metro application wiki site if you’re looking for more information about what it's going to take to convert your Silverlight applications to Windows 8 Metro applications. I think you'll be surprised by the significant amount of depth and details that are already there, and I think this information will certainly grow as time marches toward Windows 8's ship date. Just remember, WinRT could and probably will change for the better.