NavigationService.GoBack Method ()

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Navigates to the most recent entry in back navigation history, if there is one.

Namespace:   System.Windows.Navigation
Assembly:  PresentationFramework (in PresentationFramework.dll)

Public Sub GoBack

Exception Condition
InvalidOperationException

GoBack is called when there are no entries in back navigation history.

Before calling GoBack, the CanGoBack property can be inspected to determine whether there are entries in back navigation history.

The following example navigates to the most recent entry in back navigation history, if one exists.

Private Sub backButton_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
    If Me.NavigationService.CanGoBack Then
        Me.NavigationService.GoBack()
    End If
End Sub

.NET Framework
Available since 3.0
Silverlight
Available since 3.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show: