I remember reading on Microsoft web site that although WPF and Silverlight are different technologies, their libraries will eventually converge.
While this might be a declared goal, it by no means is a high priority. I recently tried to quickly port my very simple WPF demo application to Silverlight 4. What did I find?
– There is no BooleanToVisibilityConverter. It’s a very simple and useful class, takes maybe 20 lines of code. They just did not care to include it.
– Label control is not in main Silverlight libraries, but in the “SDK”. Come on. I would understand if that was Calendar, or something else which is heavy and rarely used. But Label? This makes reusing XAML between WPF and SDK difficult, since Label is quite common, and in Silverlight it is sdk:Label.
– There is no IsDefault property on buttons. I am not sure, maybe keyboard handling is very different in SL. But still, looks very strange. Shouldn’t something happen when you press ENTER? Why can’t it be a button command?
– There is no Visibility.Hidden. Well, maybe that complicated layout management and they through it away, or something. Again, makes porting code difficult.
As I said, some of these differences may have deep rooted reasons, but BooleanToVisibilityConverter?! I will be very surprised if it’s something philosophical. They just did not give it a priority.
The actual convergence isn’t really on the View side, because there are many fundamental differences between SL and WPF (Routed event,..), even if a Silverlight project being thought with some constraints can quite easily be ported to WPF. But, when applying the MVVM pattern, the whole VM stuff can be shared between SL and WPF projects. Thus, SL and WPF are only dedicated to plateform specific GUIs (because a Web interface has to be different from a heavy client one).
the whole VM stuff can be shared between SL and WPF projects.