Silverlight for Windows Phone 7 is NOT the same full Silverlight 3 RTM
Update 10/18/2010: This article is still relevant with the Windows Phone 7 RTM tools release. Even though there are differences, I spoke to a Microsoft rep and they mentioned that the two versions should converge in the next release. Hopefully, Silverlight 5 addresses these issues.
If you are a Silverlight developer or interested in the technology, you have probably heard that Microsoft released an update to Silverlight that allows you to target Windows Phone 7 Series phones. One of the different strategies Microsoft is taking with Silverlight is they are not releasing a "lite" version of Silverlight. Microsoft announced that the same code, design patterns and tools are going to be used to develop Silverlight mobile applications. This is unlike Adobe's strategy which has a Flash Lite version for their mobile devices.
Update: As Hector commented below, apparently Adobe is releaseing thefull Flash 10.1 and AIR 2 runtimes on several mobile phones. Will they be approved or blocked on the iPhone or Windows Phone 7? Check out Matthew Fabb's comments below.
Scott Guthrie announcing that Silverlight mobile is "not different" than the Silverlight we already know
After playing around with the framework and tools a little bit, I have found that to be not 100% true. It is true that at its core Silverlight for Windows Phone 7 is pretty much Silverlight 3/4 RTM. Furthermore, a developer can use both Visual Studio 2010, Expression Blend 4 and Expression Encoder 3 to create Silverlight mobile applications. However, there are some notable differences between Silverlight 3/4 RTM and Silverlight mobile that make Scott's comment during the MIX 2010 keynote not 100% accurate.
What is different between Silverlight for Windows Phone 7 and Silverlight 3/4 RTM:
1) Silverlight Mobile Compact Framework Limitations
Silverlight for the Windows 7 Phone runs on the .NET compact framework. Silverlight 3/4 run on a subset of the .NET 3/4 runtime; however, it is much richer than the .NET Compact Framework. There is a plethora of artifacts, classes and constructs that a Silverlight RTM developer might not find in Silverlight mobile. They can be found here: http://msdn.microsoft.com/en-us/library/ff426930%28VS.96%29.aspx As you can see, there are some big things missing:
- Differences in the networking stack like creating dynamic proxies with ChannelFactory is not supported (which is a WCF best practice)
- Pixel shaders are not supported
- Full blown media settings (i.e., Markers) are not supported. Only one media element can be played at once, etc.
- Multithreading differences
- There are some huge reflection limitations (i.e., some features in MEF may not work)
While these can be considered "advanced" features, they still are different. There is a list of about 30-50 things different between Silverlight mobile and Silverlight RTM.
2) Silverlight Mobile applications are only out of the browser applications
Because of the list of limitations above, the Windows Phone 7 only supports Silverlight mobile applications. If you have a Silverlight 2, 3 or 4 application on the web and browse it with a Windows 7 Phone, it will not work. That is a ridiculous limitation. The Windows Phone 6.5 includes a browser called Skyfire (http://www.skyfire.com) that can already surface Silverlight content on a mobile device. I don't know if this is a technical reason or a way for Microsoft to lock down what "apps" are surfaced on Windows Phone 7 (like Apple does with the iPhone).
What is even more insulting about this is that the Silverlight beta for Symbian Nokia S60 phones supports out of the browser Silverlight: http://mobile.engadget.com/2010/03/20/silverlight-beta-comes-to-s60-5th-edition/ . Doesn't that seem backwards?
Contols like the Silverlight Control Toolkit Charts currently throw a COM exception on the Windows Phone 7 device. I hope these things are fixed, but there is a good chance that many of these controls will have to be "watered down" or not work at all on Windows Phone 7. (Thanks to Dave Anson from Microsoft posting below that this if fixed in the next version of the toolkit).
This is also very interesting for third-party Silverlight controls. Developers and architects will have to be extra careful when investing in a graphics control package. Chances are pretty good that the controls you have used will either not work or not be suited well for Silverlight mobile. 4) Honorable mention: Silverlight for Windows Phone 7 development is C# only
As of now, you can only code Windows Phone 7 Silverlight applications in C#. I think this limitation will include VB.NET when the product launches; however, I hope this also include F# and dynamic languages as well. I would love to have F# support over VB.NET support any day! Hopefully, this makes all the VB.NET guys move to a more mature language :) As Martin Plante mentioned below, dynamic languages are not supported because of the CF limitations.
In summary, I just wanted to point out to all the Silverlight technologists out there that Silverlight mobile is not 100% the same as Silverlight 3 RTM. In fact, there are a lot of features different or missing that you need to watch out for. While it is great that Microsoft succeeded in delivering a platform that uses the same Silverlight core and tools, it would have been nice to have a full blown Silverlight runtime on the Windows Phone 7. If that were the case, patterns like MVVM would be fantastic and a single Silvelright compile and simply swapping out the Views (one for mobile and another for the web) would be fantastic.