Reputation: 2937
I'm doing some testing with Caliburn.Micro and MVVM over WPF. My App has a AppView (WPF Window) that contains a TabControl. Inside that I load my views (WPF UserControl) with its correspondin Screen ViewModel on new Tabs (Following SimpleMDI sample). Now i need to display a dialog from my viewmodel, and i do it like this:
var windowManager = new WindowManager();
var login = new ConfirmActionViewModel();
windowManager.ShowDialog(login);
The problem with this approach is that the ShowDialog method create the view Modal to the entire application (It blocks the entire application).
My Question
How can I make this dialog modal only to active view? When I say modal i mean that i need to block the view until the user click on a button of my ConfirmActionView.
I already try ModalContentPresenter class but has some problems with Caliburn and the solution is not as clean as using WindowManager. Thanks!!!!
Upvotes: 3
Views: 3444
Reputation: 367
For your specific problem the WindowManager
wont help.
In Windows (and WPF) modal means modal to all windows of the application.
Because this is not something CM can solve out of the box.
What you need is an overlay on your view. How to make overlay control above all other controls?
Then you can bind the visibility of your overlay to a property on your viewmodel.
Upvotes: 2