共用方式為


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

請參閱

參考

Frame

Page

NavigationService