Thursday, July 23, 2009

The joy of Silverlight 3 migration - no code required

In my previous post, I've showed how easy it was for me to migrate LOB application from Silverlight 2 to Silverlight 3, and now I would like to write about some Silverlight 3 goodies that don't require coding at all:

Better XAP compression rate

Silverlight 3 finally raised compression rate of XAP files, so in my case XAP file was reduced for about 10% of its previous size, although I had to add new System.Windows.Controls.Input.dll (93 KB). Very nice. No need for manually hacking compression rate anymore.

Assembly Caching

This is one of the features that is extremely useful even for very small projects. Basically, you can divide your code into couple of XAP files, for instance, third party libraries and your "changeable" code. Third party libraries can be cached, so when you change your code, only changed dlls will be downloaded to your existing clients, reducing overall payload size.

WCF binaryHttpBinding

There is no reason to keep the old WCF basicHttpBinding now the Silverlight 3 is out. "Old" Silverlight 2 sent text over wire, but now with just couple of web.config changes it is easy to setup binaryHttpBinding for WCF services and experience better WCF performances. Done. No turning back!

Better font rendering

It's hard to miss this one as that was the major reason some designers didn't like Silverlight. Finally, I am very happy that I can actually work with designers, though it looks like font rendering could be even better.

VirtualizingStackPanel in ListBoxes by default

I thought that I should do it by myself. But, hey... I get it for free :). In Silverlight 3, ListBox has VirtualizedStackPanel in ListBoxes by default, which practically means that only displayed items will be rendered, which increases performances on some forms. More details here.

New MouseWheel event

There is a new MouseWheel event exposed (without JavaScript hack!), which can be used the same way it is used in WPF application. I guess I will have to refactor old Silverlight 2 mouse wheel "quirk" code into the new simpler one.

No need for extra rebuild in bigger projects

When Silverlight 2 XAP file becomes bigger (1MB+), I have often experienced a need for separate rebuild prior starting application in debug mode, which slowed the development. It looks like it's fixed now, and I can just press F5. What a relief ;).

Noteble bug fixes

ComboBox DropDown height is finally fixed when using in cascading fashion, which caused problems in lots of LOB scenarios.

Some pitfalls

Out of browser (OOB) feature doesn't work in combination with Assembly Caching in Silverlight 3, but I guess one can overcome this limitation by using Prism for Silverlight framework or MEF for even better dynamically loading of assemblies, only when needed.
I still don't get why some classes are sealed: Shape and HtmlElement come to my mind first. There are some very old forum posts on this topic here, but apparently, nothing has changed.

These are some of my favourite Silverlight 3 enhancements which don't require any coding. How about that :).

No comments:

Post a Comment