Partager via


SilverlightHost.NavigationStateChanged Event

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

Occurs when the NavigationState property changes value.

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

Syntax

'Declaration
Public Event NavigationStateChanged As EventHandler(Of NavigationStateChangedEventArgs)
public event EventHandler<NavigationStateChangedEventArgs> NavigationStateChanged

Remarks

The NavigationState property represents the current URI fragment in the host Web browser. 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.