Region Navigation with creating Windows.

Topics: Prism v4 - WPF 4
Nov 30, 2011 at 11:38 AM

I have my main application and much of the time I am doing it within the single window. But sometimes I am going to want extra windows. For example I want to send a letter, which should open up a ribbon window letter editor with a LettersRegion within.

 

Ideally I would go:

UriQuery query = new UriQuery();

query.Add("letterType", "renewal");

this._regionManager.RequestNavigate(RegionNames.LettersRegion, new Uri("LetterView" + query.ToString(), UriKind.Relative));

 

This would then create the LettersView if it doesn't exist and inject the LetterView into it's LettersRegion, or just inject if it is already created.

What would I need to do to do this? And am I going about this the right way?

Developer
Nov 30, 2011 at 6:10 PM

Hi,

Based on my understanding, you might find the WindowDialogActivationBehavior (for WPF) or the PopupDialogActivationBehavior (for Silverlight) included with the Stock Trader RI useful to fulfill your requirements. These behaviors will allow you to define a region that, when a view is added to it, will be shown in a new window/popup.

Also, you might find the following threads useful where similar concerns are discussed:

I hope you find this helpful

Agustin Adami
http://blogs.southworks.net/aadami


Dec 6, 2011 at 2:54 PM

I'm having a bit of trouble getting started with this. Would it be possible for as simple as possible app using the WindowDialogActivationBehavior?

I see the code about in the stocktrader app, but don't see where it is actually used?? I haven't found any documentation for this? Is it available? Or going to be made available in future?

Developer
Dec 6, 2011 at 3:58 PM

Hi,

You might find the following thread useful, where you can find a sample application created by Guido Maliandi that uses the WindowDialogActivationBehavior for a simple login scenario:

I hope you find it useful,

Damian Cherubini
http://blogs.southworks.net/dcherubini

Dec 7, 2011 at 11:29 AM

Thank you that is helpful, does this work with region navigation??

Dec 7, 2011 at 11:29 AM
Edited Dec 7, 2011 at 11:30 AM

It doesn't seem to do that activation part. It seems to create the instance of the view and everything but nothing actually gets displayed.

Dec 7, 2011 at 2:00 PM

Sorted sorry, changed it from using a window to a devexpress window and didn't update this in the dialogactivation class. It is working fine.