Modal overlays/popups but modal to specific view only

Topics: Prism v4 - Silverlight 4
Sep 23, 2011 at 11:45 PM
Edited Sep 23, 2011 at 11:45 PM

I'm working on PRISM application with View-switching navigation and modules/regions.

I have 3 regions: Navigation (on top), Tabs (second one) and Main (remaining area)

Navigation on top that dinamically changes depending on modules loaded (that works)

Tabs - this is basically region that I inject 1 view into and it will visually reflect state of my navigation. All opened views will be displayed as tabs so I can click them to open view or hit "x" to dispose view. That should help users when they want to work in "MDI" mode with different documents or modify same entity via different instances of same view. This part is not done YET, but I'm reading/re-reading PRISM 4 book and I think it should be doable.

Main region - Main region will have multiple views that basically different "windows" user interact with. I want those Views to be independent from each other in certain way. They will share same services, etc. But on UI - they should not block one another. What I mean by that is if there is 2 different instances of "Order Entry" View - user will see 2 tabs in Tabs region and will be able to "navigate" from one to another by clicking on tabs.

Now to my question. Let's say I work with 2 Order Entries and in my current Active View (Order1) I do some action that requires Interaction - I'm presented with child window that blocks whole Visual Root. I want this Interaction (messagebox, selector screen, etc) to be modal only to that Active view. I.E. I want to click on another tab and go to "Order2" without a problem. And then I want to go back to Order1 and see same Interaction open. I know navigation framework provides stuff like "OnNavigatingAway" but I don't even care about that because tabs will be there.

I'm very new to Behaviors concept, every step is a pain for me :) Currently I implemented Child window using StockTraderRI code - I use "PopupRegion" on main Shell and just navigate my View's there(this code still a magic for me). I used this approach for Login screen. I also implemented InteractionRequestTrigger from PRISM library to do simple user messages.

I'm not sure in which direction I should work/search in order to achieve:

1. Modal only to parent view (not to whole shell)

2. MVVM friendly - I mean I can open popups that have view and viewmodel

3. When user closes pop-up - want to get result

Any help/pointers?


Sep 26, 2011 at 9:13 PM
Edited Sep 26, 2011 at 9:15 PM


You might find Karl Shifflett's MVVM training kit useful. This is a multi-media training which is consumed within Visual Studio 2010. It provides MVVM Technical Description and many MVVM common Scenarios that can be use as a reference.

Based on my understanding of your scenario, you might find the 04 - MVVM Scenarios application handy.

In the aforementioned link you will find the requirements and the procedure to install this training kit.

I hope you find this helpful.

Agustin Adami

Sep 27, 2011 at 1:13 AM

Thanks! Exactly what I needed. I remember that I saw it SOMEWHERE and it was from Karl but forgot where I saw it. I have this training kit installed on my PC already :)

Oct 4, 2011 at 10:07 PM

Well. I thought that's it. But it's not.. In this sample Karl uses UserControl to overlay parent Grid. Also it works visually and for mouse clicks - it doesn't work for keyboard. After dialog displayed I can tabl through underlining controls, click on buttons (tab and enter), etc.

Is there any better way?

Oct 5, 2011 at 12:32 PM
Edited Oct 5, 2011 at 12:33 PM


As this is not strictly related to Prism, you might find better support in the Silverlight forums.


Agustin Adami