NavigationWindow.Navigate Method

Definition

Navigates asynchronously to the specified source content.

Overloads

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, Object)

Navigates asynchronously to source content located at a uniform resource identifier (URI), and pass an object that contains data to be used for processing during navigation.

Navigate(Object)

Navigates asynchronously to content that is contained by an object.

Navigate(Uri)

Navigates asynchronously to content that is specified by a uniform resource identifier (URI).

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.

C#
public bool Navigate(object content, object extraData);

Parameters

content
Object

An Object that contains the content to navigate to.

extraData
Object

A Object that contains data to be used for processing during navigation.

Returns

true if a navigation is not canceled; otherwise, false.

Remarks

See NavigationService.Navigate(Object, Object).

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Navigate(Uri, Object)

Navigates asynchronously to source content located at a uniform resource identifier (URI), and pass an object that contains data to be used for processing during navigation.

C#
public bool Navigate(Uri source, object extraData);

Parameters

source
Uri

A Uri object initialized with the URI for the desired content.

extraData
Object

A Object that contains data to be used for processing during navigation.

Returns

true if a navigation is not canceled; otherwise, false.

Remarks

See NavigationService.Navigate(Uri, Object).

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Navigate(Object)

Navigates asynchronously to content that is contained by an object.

C#
public bool Navigate(object content);

Parameters

content
Object

An Object that contains the content to navigate to.

Returns

true if a navigation is not canceled; otherwise, false.

Examples

The following example shows how to navigate to content that is contained by an object.

C#
// Navigate to object using the Navigate method
this.Navigate(new HomePage());

Remarks

See NavigationService.Navigate(Object).

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Navigate(Uri)

Navigates asynchronously to content that is specified by a uniform resource identifier (URI).

C#
public bool Navigate(Uri source);

Parameters

source
Uri

A Uri object initialized with the URI for the desired content.

Returns

true if a navigation is not canceled; otherwise, false.

Examples

The following example shows how to use the Navigate method to navigate to a uniform resource identifier (URI).

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

Remarks

See NavigationService.Navigate(Uri).

Note

Uniform resource identifiers (URIs) can be either relative or absolute. For more information, see Pack URIs in WPF.

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10