Open child window from main view-model

Mar 13, 2015 at 9:29 AM
Hi,
the task I want to do is to be able to open, hide and show a child window from main window's view-model

For this purpose I can use the following tool inside my MainWindowViewModel
IUIVisualizerService
bool Show(string key, object state, bool setOwner, EventHandler<UICompletedEventArgs> completedProc);
But this method accepts a view-model as its object state parameter and I need the View-Model to be resolved with MEF, also because there's an IViewAwareStatus import in child's view-model

Whether it is possible not to create a new instance of child window's view-model and expect it will be resolved since I decorated it with
[ExportViewModel("ChildWindowViewModel")]
and the following inside ChildWindow.xaml
meffed:ViewModelLocator.ViewModel="ChildWindowViewModel"
May 13, 2016 at 7:04 PM
Try this:
[PopupNameToViewLookupKeyMetadata("ChildWindowViewModel", typeof(ChildWindowView))] 
as Attribute over the class of you child window instead of the ViewModelLocator.