can not navigationJournal back

Topics: Prism v4 - Silverlight 4
Jan 17, 2011 at 2:57 AM

[Export(typeof(AssessNodeInfoViewModel))]
    public class AssessNodeInfoViewModel : NotificationObject
    {

        private void Save(object para)
        {
            this._regionManager.RequestNavigate("AssessSchemeMiscRegion", new Uri("AddCustomNodeView", UriKind.Relative));
        }

}

[Export(typeof(AddCustomNodeViewModel))]
    public class AddCustomNodeViewModel : NotificationObject, IConfirmNavigationRequest
    {

        private void Back()
        {
            if (this._navigationJournal != null)
            {
                this._navigationJournal.GoBack();
            }
        }

}

 

i use this._navigationJournal.GoBack()  and the  navigationJournal.CanGoBack is true, but it can not go back to AssessNodeInfoView, i can't find the problem. thanks!

Jan 17, 2011 at 7:11 PM

Hi,

Please take into account that you can only go back to a view using the Navigation Journal if that view has been loaded using the Region Navigation approach. As documentation shows on Chapter 8: Navigation:

The navigation journal can only be used for region-based navigation operations that are coordinated by the region navigation service. If you use view discovery or view injection to implement navigation within a region, the navigation journal will not be updated during navigation and cannot be used to navigate forward or backward within that region.

You might find this thread about Navigation Journal useful.

I hope you find this information handy.

Thanks,

Miguel Bronzovic
http://blogs.southworks.net/mbronzovic