Using MEF, MVVM and WCF RIA Services in Silverlight 4
A sample Silverlight business application using MEF, MVVM Light, and WCF RIA Services.
MEF Programming Guide with Silverlight-specific functionality
MEF Programming Guide
- Hosting MEF in an application
- Defining Parts and Contracts
- Declaring Exports
- Declaring Imports
- Lazy Imports
- Exports and Metadata
- Using Catalogs
- Filtered Catalogs
- Part Lifetime
- Recomposition
- Querying the Composition Container
- Composition Batch
- Debugging and Diagnostics
- FAQ
Silverlight-specific functionality
Learning MEF in Silverlight 4 and .NET 4
MEF has shipped with Silverlight 4 and with .NET Framework 4.0 and there are versions on CodePlex targeting Silverlight 3 and .NET Framework V3.5 Sp1.
If you’re looking to get started with MEF then here’s some quick resources;
- Glenn Block’s new MSDN Magazine Overview Article and Glenn’s Blog
- The Overview on CodePlex
- The Programming Guide on CodePlex
- Mike Taulty’s Channel 9 Videos
but if you’re already up and running then want to know what’s new in the latest drop for the Silverlight developer?
- Updated samples!
- Renaming and changes to PartInitializer
- Renaming and moving of PartCreator
- Renaming and changes to CompositionHost.InitializeContainer
- A new DeploymentCatalog class, suport dynamically asyn load XAP files on demand!!!
For more check this out: http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2010/02/17/new-mef-drop-preview-9-on-codeplex.aspx
MEF in Silverlight Screencasts
MEF is a framework that simplifies the design of extensible applications and components. It can flexibly and dynamically discover a set of loosely coupled components and analyse their dependencies in order to compose them together at run time.
Mike Taulty has recently put up a six part series of screencasts covering the use of MEF in Silverlight 4.
In Silverlight 4, PackageCatalog has been replaced with DeploymentCatalog. Mike has this screencast showing how to use it. Also check out his blog post here.
Part 6, Locating Defaults & ExportProviders
Another screencast showing how to create a singleton plug-in service shared by a 2 instances of non-shared plug-in.
What Is The Difference Between an IoC Container and MEF?
What Is The Difference Between an IoC Container and MEF?
MEF allows you to write your application as a series of much simpler mini applications, and have those brought together to create a much great whole
IoC container = service level components, MEF = Autonomous Components. A MEF "part" will probably use an IoC container
I recommend reading them highly, they will do a much better job than I could at explaining the detail of the decision points, Should I use MEF for my general IoC needs? and Should I use MEF with an IoC container?
Managed Extensibility Framework
Watch this first: 10mins Screencast
In Silverlight 4 – Glenn Block
- PDC09 – Building Extensible RIAs with Managed Extensibility Framework
- MEF has landed in Silverlight 4. We come in the name of extensibility
- Building Hello MEF Part 1
Simple Kick Start Example using MEF (Preview 8)
- Creating the rule Interface : IRule
- Creating a rule instance
- Creating the holder for all your plug-ins
- Creating the logic to load the plugin
- Load Rules at runtime
Also from codeplex:
Read the MEF Programming Guide

