Oct 12, 2010 at 3:52 PM


I am working on a project using MEF and MEFedMVVM, MEF is used to load a number of .xap files as required, and MEFedMVVM is used to locate the ViewModels withing the dynamically loaded .xap files that contain the XAML and view models. The problem I am having is that I need to import a menu service into the ViewModels from the main module. The menu service is created as shared, but I get a new instance created for all the dynamically loaded view models. So one instance in the main module and a second instance for all the view models. Is there a way can get the instance from the main module? What I think is happening is that MEF is creating the first instance, and MEFedMVVM is creating the second.

Any help with this would be most appreciated.




Oct 13, 2010 at 8:55 AM

you should be using always MEFedMVVM so that there is one composition container!