Friday 20 May 2011

Silverlight MEF modularity loading

When designing an architecture for Silverlight applications it’s important to break down your application into loosely coupled modules, which can then be composed to create your system.

ScreenShot028

In this example you can see our solution contains our main Silverlight application, the web hosting project and a further six loadable modules named A - F.  There is also a ninth project called ModuleTracking which tracks the state of the loadable modules e.g. ModuleE 39% downloaded.

vs

The main application project can discover these modules through either direct project references or, more importantly, through a configuration file or directory sweep. When using the configuration file (ModulesCatalog.xaml in the example code) you can define dependencies so that a working module is always provided.

 

To download the source code please visit the PRISM website and select active releases v4:

http://msdn.microsoft.com/en-us/library/ff648465.aspx

No comments:

Post a Comment