I have a simple WPF wizard with a few screens. I am using the standard MEF bootstrapper, with one small change - I am using the name of my first ViewModel instead of an IShell.
public class BootStrapper : Bootstrapper<MessageTypeViewModel>
The WindowManager class is created by MEF, and I am using this to handle window creation and navigation. The import of this seems to work for the first window displayed (MessageTypeView), but all other imports fail for the subsequent windows I create
manually with the following code:
private IWindowManager _windowManager;
I have managed to get this working using IOC.Get(), but understand that this is bad practice and should be avoided if possible.
Any ideas why the views/viewmodels I create manually don't get the dependencies satisfied by MEF?