How to create an Instance-spcecific bootstrapper?

Topics: Bootstrappers & IoC
Mar 4, 2013 at 8:14 PM
This question is related to

I have an application with a Shell and Workspace(s). Both objects import a IMyMenu object. IMyMenu allows viewmodels to register commands.

Now I would like to open a new window with its own bootstrapper and import the same Types of Workspace(s) and IMyMenu. Again, although the boostrapper would be importing the same object types as the main Shell, the instances need to belong to the new window.

The challenge is that the IMyMenu needs to be shared per instance of each Shell, so that each Shell's children can import and register on the same object. I belive I could just create a Static/Shared property of IMyMenu, but I'd like to explore a MEF only solution.