The HelloWindowManager Caliburn.Micro sample demonstrates displaying a Window (View) as Modal, Modeless or Popup and works just fine. However it has the views and Viewmodels in the project root so I wanted to tidy it up and have it use the default convention for view and view model locations, so I made the following changes:
- Created a Views folder and moved both the ShellView.xaml and DialogView.xaml within it
- Created a ViewModels folder and moved the matching View Models
- Adjusted the namespace in the 4 files to reflect the move
On running the revised sample now I have the weird behaviour that while the 'Open Modal' button works perfectly, thus demonstrating that the View for the VM CAN be found, both the Open Modeless and the Open Popup buttons result in the message "Cannot find View for caliburn.Micro.HelloWindowmanager.ViewModels.DialogViewModel"
Any ideas?
Edited to add:
Absent any answers from anyone, I modified the sample to use the SimpleContainer instead of MEF - and it displays exactly the same behaviour as above.
e.g. This call works:
var result = windowManager.ShowDialog(new DialogViewModel());
but these two calls result in the 'cannot find view...' error message
windowManager.ShowWindow(new DialogViewModel(), "Modeless");
windowManager.ShowPopup(new DialogViewModel(), "Popup", settings);
Should I somehow be adding DialogViewModel to the SimpleContainer?