Thursday, June 10, 2010

My offline extension of DeploymentCatalog

DeploymentCatalog works well in many scenarios. However, when you start  Silverlight out of browser application in offline, cached .xap is not found. So I have extended standard DeploymentCatalog to support offline scenario.

How my offline extension works?

In online out of browser application downloads (or gets from cache) .xap file and saves it  in an additional place - MyDocuments folder. I use trusted mode, so saving works without user interaction and space limit.

When you start out of browser application in offline, .xap file is loaded from MyDocuments folder.

MEF_Offline_Xap_2

I have created DeploymentCatalogWithOffline based on modified DeploymentCatalog sources.  I have changed only implementation of  HandleOpenReadCompleted method (see the screenshot below).

MEF_Offline_Xap_1

You can download complete solution here.