Поделиться через


Как перейти на страницу

В этом примере показано несколько способов перехода на страницу из объекта NavigationWindow.

Пример

Можно NavigationWindow перейти на страницу одним из следующих способов:

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

Замечание

Универсальные идентификаторы ресурсов (URI) могут быть относительными или абсолютными. Дополнительные сведения см. в URI пакетов в WPF.

См. также