Provides data for the OnNavigatingFrom method and the Navigating event.
<TypeForwardedFromAttribute("System.Windows.Controls.Navigation, Version=2.0.5.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")> _ Public NotInheritable Class NavigatingCancelEventArgs _ Inherits CancelEventArgs
[TypeForwardedFromAttribute("System.Windows.Controls.Navigation, Version=2.0.5.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")] public sealed class NavigatingCancelEventArgs : CancelEventArgs
The NavigatingCancelEventArgs type exposes the following members.
The NavigatingCancelEventArgs object provides event arguments for the OnNavigatingFrom method on a Page or the Navigating event. The Navigating event is raised or the OnNavigatingFrom method is called just before navigating from a page.
You can prevent a navigation request by setting the Cancel property to true. To evaluate a navigation request, you can examine the values of the NavigationMode and Uri properties.
The following example shows how to override the OnNavigatingFrom method and use the NavigatingCancelEventArgs object to determine if a child window is displayed.
Partial Public Class About Inherits Page Public Sub New() InitializeComponent() End Sub Protected Overrides Sub OnNavigatingFrom(ByVal e As System.Windows.Navigation.NavigatingCancelEventArgs) If (e.Uri.ToString().Contains("/Home")) Then Dim surveyChildWindow As New SurveyWindow surveyChildWindow.Show() End If MyBase.OnNavigatingFrom(e) End Sub End Class
public partial class About : Page { public About() { InitializeComponent(); } protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) { if (e.Uri.ToString().Contains("/Home")) { SurveyWindow surveyChildWindow = new SurveyWindow(); surveyChildWindow.Show(); } base.OnNavigatingFrom(e); } }
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.