WPF Open a Modal window from UserControl

modal-dialogmvvmwpf

I have a MainWindow in my WPF app.

This MainWindow has a menu on the left and when a menu option is selected a UserControl is loaded on the right.
This is similar to Master Pages in asp.net

What I want to do now is to have a modal window show from the UserControl which will only allow the user to interact with the modal window.

I have seen examples of the Main Window showing a modal window (http://www.codeproject.com/Articles/36516/WPF-Modal-Dialog) but not sure on how to load this from a UserControl.

Best Answer

There's this: dialogs and mvvm but this is the best example I've seen of dealing with it: mvvm and closing forms

The first link I've not used and stumbled across while looking for the second link to post that here. The second link has two downloads, you can ignore the _service download, it's basically the same.

Related Topic