==Update==
I have found a solution and I blogged about it here: link
However I'd be more than happy if someone came up with a better one.**
Using MEF I want to do the following.
I have a WPF Shell. To the shell I want to Import from another DLL a UserControl that is also a View of my MVP triad. The way the MVP triad works, is that in presenter I have a constructor that takes both IModel and IView and wires them up. So, in order for this to work, I need MEF to do the following:
- Create IView implementation
- Create IModel implementation
- Create Presenter and pass IModel and IView to its constructor
- Import IView implementation into my shell when it gets displayed
Instead what it does, is it only creates the type Exporting IView and passes it to the shell, basically skipping steps 2 and 3. Its pretty logical, when you think about it, but how can I tell MEF to also create the whole triad when I ask for a IView. I don't need to reference Presenter nor model anywhere else in my Shell .dll so puting it as an Import as well is not an option (and it would be quite ugly anyway :).
I'm using the latest drop of MEF (Preview 2 Refresh). Anyone?