HOW TO:巡覽至頁面
本範例說明可以從 NavigationWindow 巡覽至頁面的幾種方法。
範例
NavigationWindow 可以使用下列其中一項功能,巡覽至頁面:
' 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());
![]() |
---|
Uniform resource identifiers (URIs) 可以是相對的,也可以是絕對的。如需詳細資訊,請參閱 WPF 中的 Pack URI。 |