Navigation and open views

Topics: Prism v4 - Silverlight 4
Dec 23, 2011 at 9:59 AM

Hi all

I'm looking at using Prism navigation in a new silverlight project.  When the user opens a view and enters some data, then opens another instance of the same view can I call some method like 'Show all open views' in the navigation framework that will return me the list of open views that I can then navigate to?

p.s I came across an app by Karl Shifflett (http://karlshifflett.wordpress.com/2010/02/07/bbq-shack-ocean-v2-for-visual-studio-2008/) that does what I want to do but was wondering if this is built into the navigation framework as I'm using Prism in other aspects of my app I'd like to stick to one framework.

Thanks

Paul

Developer
Dec 23, 2011 at 5:42 PM

Hi,

Based on my understanding of your scenario, you might benefit from using the IsNavigationTarget method on the INavigationAware interface provided with Prism. This way, when making a navigation request, by using the NavigationContext to retrieve the passed parameters in the navigation URI you should be able to determine whether or not an existing view can handle the navigation request. If there is a proper view in the region, this view will be shown instead of a new view. This is useful in scenarios where you are navigating to the same type of view but need to display different information.

You can find more information about this in Chapter 8: Navigation of the Prism documentation at MSDN:

Regarding the Non-Linear Navigation used in BBQ Shaq app, as far as I know, as Karl Shifflet's mentioned in this other blog post: Prism v4 Region Navigation Pipeline, it might not be required in Prism to implement the Non-Linear Navigation interfaces if you don't need to, as the Prism v4 Navigation API might be enough in most common navigation scenarios.

On the other hand, I believe you could also find this other post of your interest, where you can find how to integrate Prism v4 Region Navigation with Silverlight 4 Frame Navigation, which is not supported by the Prism v4 Library out of the box and, additionally, implementing Non-Linear Navigation features:

I hope you find this useful,

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

Dec 31, 2011 at 11:08 AM

Thanks Agustin

Will have a look at the links provided