RequestNavigate behavior

Topics: Prism v4 - Silverlight 4
Nov 30, 2010 at 9:07 PM

Hi,

I'm using RequestNavigate to inject different views within a region.  I need to have a central service to perform something, other than navigating like update content in other part of the application, everytime RequestNavigate is being called. Besides having NavigationCompleted event delegate that task. Is there any way to monitor this behavior?

Thanks,

T

Dec 1, 2010 at 6:12 PM

Hi T,

When you implement the INavigationAware interface in your views, you have to provide an implementation for the IsNavigationTarget method. This method will be called during the navigation pipeline after calling the RequestNavigate method in the Region class.

From the INavigationAware documentation on MSDN, it “Provides a way for objects involved in navigation to be notified of navigation activities”.

That said, a possible approach might be to add your code in this method. If you need more guidance about Navigation, you can take a look at the following links:

Additionally, if the aforementioned does not fit in your scenario, another possible approach might be to add a handler to the CollectionChanged event of the ActiveViews property in the Region class. In that case, you would be notified when the active view is changed.

Hope this helps.

Fernando Antivero
http://blogs.southworks.net/fantivero