Condividi tramite


Procedura: passare a una pagina

In questo esempio vengono illustrati i vari modi disponibili per spostarsi su una pagina da un oggetto NavigationWindow.

Esempio

È possibile spostarsi su una pagina da un oggetto NavigationWindow utilizzando la proprietà o il metodo indicato di seguito:

            ' Navigate to URI using the Source property
            Me.Source = New Uri("HomePage.xaml", UriKind.Relative)

            ' Navigate to URI using the Navigate method
            Me.Navigate(New Uri("HomePage.xaml", UriKind.Relative))

            ' Navigate to object using the Navigate method
            Me.Navigate(New HomePage())
// Navigate to URI using the Source property
this.Source = new Uri("HomePage.xaml", UriKind.Relative);

// Navigate to URI using the Navigate method
this.Navigate(new Uri("HomePage.xaml", UriKind.Relative));

// Navigate to object using the Navigate method
this.Navigate(new HomePage());
NotaNota

Uniform resource identifiers (URIs) può essere assoluto o relativo.Per ulteriori informazioni, vedere URI di tipo pack in WPF.

Vedere anche

Riferimenti

Frame

Page

NavigationService