Partager via


SilverlightHost.NavigationState Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets a URI fragment that represents the current navigation state.

Namespace:  System.Windows.Interop
Assembly:  System.Windows (in System.Windows.dll)

Syntax

'Declaration
Public Property NavigationState As String
public string NavigationState { get; set; }

Property Value

Type: System.String
A URI fragment that represents the current navigation state.

Exceptions

Exception Condition
ArgumentNullException

When setting this property, the specified value is nulla null reference (Nothing in Visual Basic).

Remarks

A URI fragment is the part of a URI that occurs after a pound sign (#). Setting this property causes the browser to update the URI in its address bar and causes the NavigationStateChanged event to occur. The property value will also change (and the event will occur) if a user updates the URI in the address bar. Additionally, the URI with the new fragment is added to the navigation history so that users can navigate back to it.

You can handle NavigationStateChanged event to provide custom application navigation. However, in most cases, you should use the Frame and Page controls to provide application navigation. For more information, see Navigation Overview.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.