Posterous theme by Cory Watilo

Filed under: silverlight

Silverlight, Out of Browser and GZip

Much to my dismay, Silverlight 4 going out of browser with GZip compression just isn't supported.  With Silverlight in the browser, the browser will likely add the Accept Encoding header with gzip (and probably deflate) for you.  Then the browser will also decode the optionally gzipped data automagically.

I guess that's why there is no GZipStream in Silverlight at all :)

Fortunately, I can use my own project SharpCompress to help me out.

Using the WCF WebAPI, I compress everything on the server and inspect the content on the Silverlight client then just ungzip.

Using Merged Resource Dictionaries inside Themes/generic.xaml

If you include a ResouceDictionary into Themes/generic.xaml you will receive an exception telling you that the dictionary cannot be assigned to property ‘Source’ of object, yada, yada, yada, very informative.

Problem, solution. Thanks google.

I guess it makes sense since other assemblies cannot look at the generic.xaml and use the local URI to resolve the included xaml files.