Microsoft just released the version 5 of Silverlight! It’s a great news and I really want to congratulate the whole team on this impressive collective effort. The official announcement is on the Silverlight team blog!
The purpose of this article is not to be exhaustive about the list of features (there have been, and will be, many more very detailed articles such as this series on the Silverlight blog) but rather to explain why this version in particular makes me happy to be a Silverlight developer (features listed in no particular order!).
One thing is making me really happy and excited: the 3D integration. It is now possible to include and manipulate 3D models within a Silverlight application. This model is very similar to what XNA offers, which means that existing XNA developers will feel at home very fast with this new platform. It also means that existing 3D models can quite easily be run in Silverlight 3D. I am sure we all have in mind the pretty amazing demo with Scott Gu’s avatar during the Silverlight 5 firestarter (jump to 51:11).
I am really happy to have 3D integration in Silverlight now, because I have been working for the past few weeks on a new application for Kinect for Windows involving a 3D human avatar integrated in a Windows Presentation Foundation. The integration is completely seamless, and it looks like the avatar is completely part of the rest of the application. However, the rest of the application is WPF, with all the XAML, binding and MVVM goodness that it brings. This kind of seamless integration is now also possible in Silverlight, and that opens the door to a lot of pretty cool applications and a new kind of user experience.
In-browser trusted applications
We all know (or heard of) the Out-Of-Browser (OOB) application model which allows Silverlight to run outside of a web browser, just like a Windows application in its own windows, with its own shortcut, etc. There is also an elevated trust model for OOB, declared at build time, which allows such applications to perform tasks that are usually not allowed (such as saving or reading files from certain locations on the computer, run in full-screen with full keyboard support (ideal for kiosk applications!), host HTML pages within the Silverlight application, etc.
These features were already available in Silverlight 4, however in Silverlight 5 they are also possible inside the web browser. This makes the delivery of such applications a little easier, since the user does not have to “install” them and deal with a shorcut.
This feature allows to play video at various speeds, and even includes pitch correction to avoid that the speaker sounds like a chipmunk! This is especially useful when watching conference sessions: watch a whole 60 minute session in 30 minutes, and use the rest of the hour to be with your family instead
Breakpoints in bindings
This one is pretty cool: Who has never had to debug a binding, because the binding expression had a typo, or the value was not what you expected? it was pretty cumbersome before! Well with Silverlight 5, you can set a breakpoint right in the XAML binding expression, and the debugger will break and allow you to inspect the expression!.
A lot of work has been put into performance too, and a new set of tools helps to profile the application and identify critical areas that need perf tuning.
This is like COM on steroid: This allows your Silverlight application to access pretty much any of the Win32 APIs directly from within your app. There are even ways to listen to Win32 messages, for example to be notified when a new USB drive is inserted (this is only an example!). There is a good article on pinvoke by Alexandra Rusina (one of Silverlight’s PMs) here.
Note that pinvoke only works with elevated permissions, which really makes sense (I wouldn’t want any script kiddy to be able to format my hard drives without saying “OK” first)!!.
There are a lot of other improvements, notably useful when you use the MVVM pattern in Silverlight. For example, the ability to search for an Ancestor in a RelativeSource binding (something we had since the beginning in WPF, and because it was missing here led to some cruel workarounds in some applications in Silverlight…) is a good example of these apparently small changes, but that will mean a lot when you do need them.
With version 5, we have a super mature version of the framework!
What about Mac? What about other browsers? What about delays? What about Maryjo?
As usual it is interesting to witness the drama around the (perceived) delay in the delivery of this massive new version. It is important however to remember that there had not been any official announcement about a delivery date (the only thing we had heard was Scott Guthrie – who is not in charge of this product anymore by the way – talk about “end of November”). With a delivery in the first half of December, and considering that much time has been spent on last minute bugs, making this version as stable as can be, and (again) considering the massive additions to this new version, I say kudos to the team!
Edit: Maryjo felt insulted and I am a nice guy, so let me rework that paragraph a bit. Yeah I went too far and personal, so hopefully this is better.
Maryjo Foley, who seems to be reporting and speculating on a lot of bad news these days, reported that Mac OS would not be supported for Silverlight 5, and even worse that only Internet Explorer would be supported on Windows.
Side note: She actually reported that “One of my contacts said he believed that the final version of Silverlight 5 may only work with Internet Explorer on Windows and won’t work on Mac OS platforms or with other browsers at all. (Silverlight 4 supports Windows and Mac OS X and the IE, Chrome and Safari browsers.)”. Notice the lack of named reference, the “he believed” and the “may work”.
It’s a good example of why we should take this kind of “journalism” with a grain of salt. We are very rational people, fond of science and technology, and yet we seem sometimes to act like schoolgirls when someone writes something on the web. At this point, I think it is good to remember that Maryjo often reports hearsay and rumors. I don’t mean that she is always wrong, not at all, and in fact I do read her column with interest. But I always take it with a (large) grain of salt, and I remember that until a product is released, we don’t know what it will support. Everything else, really, is conjectures. A good thing to remember while Windows 8 is in preparation!
Side note again: It is very painful to insiders to read this kind of articles (if you can call it that) while we knew very well that it was completely wrong. Unfortunately, the non-disclosure agreement that binds us to Microsoft prevents us from correcting assertions like this, and we had to sit down and watch. This is very unfortunate and painful. I really hope that people learn, some day, to be reasonable when it comes to technology (but I am not holding my breath).
To be clear: the list of supported web browsers and operating systems did not change. It is available at http://www.microsoft.com/silverlight/what-is-silverlight/.
There are a few restrictions around the 3D rendering, for security reasons. The best summary I found so far is on David Catuhe’s blog. Security restrictions are always annoying but the alternative is letting unsafe code run on the user’s computer, and we all know how Microsoft handled that in the past (ActiveX anyone?) so I guess that we need to accept that they err on the side of security this time. (Edit: updated on 12/10/2011).
Also, like previously, COM access does not work on Mac OSX and as I mentioned above, p/invoke is also only available on Windows. Both these features require elevated permissions by the way.
What about MVVM Light?
MVVM Light will of course support Silverlight 5, and I will release a version soon. I just need a little more time running my tests and making sure that everything is working as expected. Stay tuned to this blog for an announcement about the release of MVVM Light for Silverlight 5!
A few additional updates
Well there was a nice storm on Twitter, and within the noise I managed to grab a few useful facts.
First, the Blend preview for Silverlight 5 is available here. I did not verify that it works with Silverlight 5 RTM, but I think it should.
Then, Silverlight 5 will be supported until December 2021. That’s 10 years of support.
The offline documentation can also be downloaded.
Finally there was a lot of passionate discussions on Twitter tonight. I think it was especially interesting to confront the view of tech journalists versus MVPs vs developers. Bottom line is that there is a lot of passion around tech these days. I personally think it is too much passion, but some disagree and I think we will have to live with that for years to come…