Hi,
Based on my understanding the view model can be instantiated in XAML as the view’s DataContext only if a view model does not have any constructor arguments. And as far as I know creating objects defined inXAML by partnering with an Inverse of Control Container is currently not supported.
Regarding the CompositionInitializer class, as far as I know there is no equivalent class forWPF, on the other hand regarding this topic, I believe you could find the following blog post interesting:
Also, I believe an alternative for this could be registering the CompositionContainerclass like mentioned in this thread:
As this could let you retrieve this class for example in your view model's constructor, in order to call theSatisfyImportsOnce method to satisfy the Imports defined in the passed class:
this.compositionContainer =ServiceLocator.Current.GetInstance<CompositionContainer>();this.compositionContainer.SatisfyImportsOnce(this);
Agustin Adami
http://blogs.southworks.net/aadami