NavigationFailedEventArgs.Handled Property

Gets or sets a value that indicates whether the failure event has been handled.

Namespace:  System.Windows.Navigation
Assembly:  System.Windows.Controls.Navigation (in System.Windows.Controls.Navigation.dll)

public bool Handled { get; set; }

Property Value

Type: System.Boolean
true if the event has been handled; otherwise, false.

When you have handled the exception and do not want the Silverlight framework to re-throw the exception, set the Handled property to true.

The following example shows a handler for the NavigationFailed event of the Frame class. When navigation to a page within the frame fails, a child window is displayed that contains an error message and the URI of the requested page. The code for the child window named ErrorWindow is not shown in this example, but must be included in the application for the example to work. The Handled property is set to true to indicate that the event has been handled and an exception should not be thrown.


private void ContentFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
{
    e.Handled = true;
    ChildWindow errorWin = new ErrorWindow(e.Uri);
    errorWin.Show();
}


Silverlight

Supported in: 5, 4, 3

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

Community Additions

ADD
Show: