Udostępnij za pośrednictwem


Instrukcje: przechodzenie do strony

W tym przykładzie pokazano kilka sposobów, w których można przejść do strony z NavigationWindow.

Przykład

Istnieje możliwość przejścia NavigationWindow do strony przy użyciu jednej z następujących opcji:

// 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());
' 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())

Uwaga / Notatka

Identyfikatory URI mogą być względne lub bezwzględne. Aby uzyskać więcej informacji, zapoznaj się z hasłem Pack URIs w WPF.

Zobacz także