如何:定位到页

更新:2007 年 11 月

此示例演示从 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());
说明:

统一资源标识符 (URI) 可以是相对的,也可以是绝对的。有关更多信息,请参见 Windows Presentation Foundation 中的 Pack URI

请参见

参考

Frame

Page

NavigationService