Search code examples
c#wpfc#-4.0mefwpf-4.0

Equivalent of CompositionInialiser.SatisfyImports(this) in WPF4?


I am a Silverlight programmer trying my hands at WPF4. In Silverlight 4 while using MEF we write CompositionInialiser.SatisfyImports(this) which allows the MEF to discover parts and plug them in. What is the equivalent of this line in WPF 4?

This static method is not available in MEF while using it with WPF.


Solution

  • There is, but it's kinda convoluted.

    Composition.Initialization.Desktop.zip

    See this post:

    http://rickrat.wordpress.com/2011/01/24/using-mef-to-link-view-model-locator-and-load-assembly-uis-dynamically/