NavigationService.GoBack Método

Definición

Navega hasta la entrada más reciente del historial de retroceso de navegación, si lo hay.

public:
 void GoBack();
public void GoBack ();
member this.GoBack : unit -> unit
Public Sub GoBack ()

Excepciones

Se llama a GoBack() cuando no hay ninguna entrada en el historial de navegación hacia atrás.

Ejemplos

En el ejemplo siguiente se navega a la entrada más reciente en el historial de navegación posterior, si existe.

void backButton_Click(object sender, RoutedEventArgs e)
{
    if (this.NavigationService.CanGoBack)
    {
        this.NavigationService.GoBack();
    }
}
Private Sub backButton_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
    If Me.NavigationService.CanGoBack Then
        Me.NavigationService.GoBack()
    End If
End Sub

Comentarios

Antes de llamar a GoBack, la CanGoBack propiedad se puede inspeccionar para determinar si hay entradas en el historial de navegación posterior.

Se aplica a

Consulte también