How to implement a custom navigation journal?

Apr 28, 2011 at 11:50 AM

I would like to implement a menu with a list of last recently navigated views within a region. I would like to use the entries in the navigation journal as the dataset for the menu list. It seems that the navigation journal provided by prism 4 doesn't provide access to the entries in the journal. In the the Developer's guide to Prism it is noted that it's possible to implement a custom navigation journal for a region.

How can I implement a custom navigation journal and configure it in my specific region?




Apr 28, 2011 at 1:08 PM

Hi Marco,

You can implement a custom Region Navigation Journal by creating a class that implements the IRegionNavigationJournal interface, and export it to the dependency injection container that you use.

For example, the MefRegionNavigationJournal class, which is responsible for providing an export of the default RegionNavigationJournal class mentions the following:

"This allows the MefBootstrapper to provide this class as a default implementation. If another implementation is found, this export will not be used."

In case you're using Unity, you could override the ConfigureContainer method and register your custom RegionNavigationJournal before calling the base implementation. That would result in your implementation overriding the default one.

I hope you find this helpful.

Guido Leandro Maliandi

Apr 28, 2011 at 4:23 PM

Hi Guido

Ok, that could work. If I register my custom navigation journal in the Bootstrapper my custom navigation journal will be used in every region. I'm not sure if this will be a problem. I will certainly give it a try.