Popup Dialog

Topics: Prism v4 - WPF 4
Dec 21, 2011 at 6:13 PM

I looked at the StockTrader RI solution and noticed that the NewsReaderView exits as a separate window outside the main window.  I would like to popup a modal dialog inside (on top of) the current view in my MainRegion.  How would I go about implementing this?


Dec 21, 2011 at 7:41 PM


Take into account that the scenario of locating a Window in an specific location of the desktop is not supported by Prism or the WindowDialogActivationBehavior out of the box.

Based on my understanding of your scenario, as a possible approach you could use a Shared Service (for example, a singleton object that could be obtained through the service locator) to define the Left and Top properties for your dialog before adding a view to the "dialog region". Then, you could modify the WindowWrapper class to consume this service and ,for example, set the Left and Top properties of the window in the Show method.

I hope you find this useful,

Damian Cherubini

Dec 21, 2011 at 9:49 PM


This is not the answer I was expecting.  Is there a WPF PRISM example that shows the use of a Interaction Request?

Thank You

Dec 22, 2011 at 4:56 PM


It seems that we have missunderstood your scenario, our previous response was based on our understanding of the approach used to create a dialog or modal window with the WindowDialogActivationBehavior provided in the StockStrader RI.

On the other hand regarding the use of a InteractionRequest in WPF, you might find that the samples applications provided by Prism out of the box which implement this approach are targeted only to Silverlight (e.g. MVVM RI, StateBased Navigation Quickstart and ViewSwitching Navigation Quickstart). The implementation mechanism for WPF should be the same, except that in WPF there is no implementation of "ChildWindow" and you might have to design a custom dialog window.

You might find that this is also addressed in the following Codeplex discussion, where Karl Shifflet posted that he provided a WPF version of the InteractionRequest in his In The Box MVVM Training (specifically in DialogInteractionRequestView.xaml of the MVVM Scenarios application).

If you find that this is not useful regarding you scenario, it would be helpful to us if you could provide us with a little more information so we could help you futher with this.

I hope you find this handy,

Agustin Adami

Dec 23, 2011 at 2:25 AM

Thanks for your help.  I will look into the references you suggested.  I did find an article on Code Project by Gerard Castelllo Viader helpful.



Dec 25, 2011 at 12:14 AM

I think you want to check "MVVM in the BOX" training - there is example on how to do interaction requests modal to specific view, not whole shell. I implemented it, but it is not 100% - since what you do you overlay view on top of another view and also you can't click on it with mouse - you can TAB into overlayed controls. I solved it by disabling all controls bevore showing dialog and enabling all after hiding dialog.