Frame.Navigate 方法

定义

异步导航到指定的源内容。Navigates asynchronously to the specified source content.

重载

Navigate(Uri, Object)

异步导航到位于某个统一资源标识符 (URI) 的源内容,并传递一个对象,该对象包含要在导航过程中进行处理的数据。Navigates asynchronously to source content located at a uniform resource identifier (URI), and passes an object that contains data to be used for processing during navigation.

Navigate(Object, Object)

异步导航到包含在某个对象中的内容,并传递一个对象,该对象包含要在导航过程中进行处理的数据。Navigates asynchronously to content that is contained by an object, and passes an object that contains data to be used for processing during navigation.

Navigate(Uri)

异步导航到由统一资源标识符 (URI) 指定的内容。Navigates asynchronously to content that is specified by a uniform resource identifier (URI).

Navigate(Object)

异步导航到包含在某个对象中的内容。Navigates asynchronously to content that is contained by an object.

Navigate(Uri, Object)

异步导航到位于某个统一资源标识符 (URI) 的源内容,并传递一个对象,该对象包含要在导航过程中进行处理的数据。Navigates asynchronously to source content located at a uniform resource identifier (URI), and passes an object that contains data to be used for processing during navigation.

public:
 virtual bool Navigate(Uri ^ source, System::Object ^ extraData);
public bool Navigate (Uri source, object extraData);
abstract member Navigate : Uri * obj -> bool
override this.Navigate : Uri * obj -> bool
Public Function Navigate (source As Uri, extraData As Object) As Boolean

参数

source
Uri

使用所需内容的 URI 初始化的 Uri 对象。A Uri object initialized with the URI for the desired content.

extraData
Object

一个 Object,其中包含要在导航过程中进行处理的数据。A Object that contains data to be used for processing during navigation.

返回

如果未取消导航,则为 true;否则为 falsetrue if navigation is not canceled; otherwise, false.

注解

请参阅 NavigationService.Navigate(Uri, Object)See NavigationService.Navigate(Uri, Object).

Navigate(Object, Object)

异步导航到包含在某个对象中的内容,并传递一个对象,该对象包含要在导航过程中进行处理的数据。Navigates asynchronously to content that is contained by an object, and passes an object that contains data to be used for processing during navigation.

public:
 virtual bool Navigate(System::Object ^ content, System::Object ^ extraData);
public bool Navigate (object content, object extraData);
abstract member Navigate : obj * obj -> bool
override this.Navigate : obj * obj -> bool
Public Function Navigate (content As Object, extraData As Object) As Boolean

参数

content
Object

一个 Object,其中包含要导航到的内容。An Object that contains the content to navigate to.

extraData
Object

一个 Object,其中包含要在导航过程中进行处理的数据。A Object that contains data to be used for processing during navigation.

返回

如果未取消导航,则为 true;否则为 falsetrue if navigation is not canceled; otherwise, false.

注解

请参阅 NavigationService.Navigate(Object, Object)See NavigationService.Navigate(Object, Object).

Navigate(Uri)

异步导航到由统一资源标识符 (URI) 指定的内容。Navigates asynchronously to content that is specified by a uniform resource identifier (URI).

public:
 virtual bool Navigate(Uri ^ source);
public bool Navigate (Uri source);
abstract member Navigate : Uri -> bool
override this.Navigate : Uri -> bool
Public Function Navigate (source As Uri) As Boolean

参数

source
Uri

使用所需内容的 URI 初始化的 Uri 对象。A Uri object initialized with the URI for the desired content.

返回

如果未取消导航,则为 true;否则为 falsetrue if navigation is not canceled; otherwise, false.

示例

下面的示例演示如何使用 Navigate 方法导航到统一资源标识符(URI)。The following example shows how to use the Navigate method to navigate to a uniform resource identifier (URI).

// Navigate to URI using the Navigate method
this.Navigate(new Uri("HomePage.xaml", UriKind.Relative));
' Navigate to URI using the Navigate method
Me.Navigate(New Uri("HomePage.xaml", UriKind.Relative))

注解

请参阅 NavigationService.Navigate(Uri)See NavigationService.Navigate(Uri).

备注

统一资源标识符(Uri)可以是相对的,也可以是绝对的。Uniform resource identifiers (URIs) can be either relative or absolute. 有关详细信息,请参阅 WPF 中的 Pack URIFor more information, see Pack URIs in WPF.

Navigate(Object)

异步导航到包含在某个对象中的内容。Navigates asynchronously to content that is contained by an object.

public:
 virtual bool Navigate(System::Object ^ content);
public bool Navigate (object content);
abstract member Navigate : obj -> bool
override this.Navigate : obj -> bool
Public Function Navigate (content As Object) As Boolean

参数

content
Object

一个 Object,其中包含要导航到的内容。An Object that contains the content to navigate to.

返回

如果未取消导航,则为 true;否则为 falsetrue if navigation is not canceled; otherwise, false.

示例

下面的示例演示如何导航到对象所包含的内容。The following example shows how to navigate to content that is contained by an object.

// Navigate to object using the Navigate method
this.Navigate(new HomePage());
' Navigate to object using the Navigate method
Me.Navigate(New HomePage())

注解

请参阅 NavigationService.Navigate(Object)See NavigationService.Navigate(Object).

适用于