0

I have problem in finding the last navigation url.

From Page A i am going to Page B. When clicking on back button on page B will take me back to Page A. My question is how to i get the last page(Page B) url in Page A.

Any one can help me please?

Thanks in advance.

user1845163
  • 307
  • 1
  • 5
  • 17

1 Answers1

0

This was answered previously on SO:

Is there any way to get previous page url in silverlight navigation application


The accepted answer was:

There is no way to get the navigation history, you can store it by yourself by listening the navigation service event NavigationService.Navigated (or Frame.Navigated for frame navigation).

private List<Uri> _navigationHistory = new List<Uri>();

void  onNavigated(object sender, NavigationEventArgs e)
{
    _navigationHistory.Add(e.Uri);
}

private Uri getBackUri()
{
    return _navigationHistory.Count > 1
        ? _navigationHistory[_navigationHistory.Count - 2]
        : null;
}
Community
  • 1
  • 1
Code Maverick
  • 20,171
  • 12
  • 62
  • 114