NavigationService.GoBack Método

Definição

Navega até à entrada mais recente no histórico de navegação retroativa, se houver.

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

Exceções

GoBack() é chamada quando não há entradas no histórico de navegação retroativa.

Exemplos

O exemplo seguinte conduz até à entrada mais recente no histórico de navegação retroativa, caso exista.

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

Observações

Antes de ligar GoBackpara , a CanGoBack propriedade pode ser inspecionada para determinar se existem entradas no histórico de navegação retroativa.

Aplica-se a

Ver também