次の方法で共有


NavigationFailedEventArgs.Uri Property

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

Gets the uniform resource identifier (URI) for the content that could not be navigated to.

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

Syntax

'Declaration
Public Property Uri As Uri
public Uri Uri { get; private set; }

Property Value

Type: System.Uri
A value that represents the URI.

Examples

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 Sub ContentFrame_NavigationFailed(ByVal sender As Object, _
         ByVal e As NavigationFailedEventArgs) Handles ContentFrame.NavigationFailed
    e.Handled = True
    Dim errorWindow As ChildWindow = New ErrorWindow(e.Uri)
    errorWindow.Show()
End Sub
private void ContentFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
{
    e.Handled = true;
    ChildWindow errorWin = new ErrorWindow(e.Uri);
    errorWin.Show();
}

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

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