Udostępnij za pośrednictwem


NavigationFailedEventHandler Delegate

Definition

Represents a method that will handle the WebView.NavigationFailed and Frame.NavigationFailed events.

public delegate void NavigationFailedEventHandler(Platform::Object ^ sender, NavigationFailedEventArgs ^ e);
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.Guid(1303070321, 4786, 17351, 184, 146, 155, 226, 220, 211, 232, 141)]
class NavigationFailedEventHandler : MulticastDelegate
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.Guid(1303070321, 4786, 17351, 184, 146, 155, 226, 220, 211, 232, 141)]
public delegate void NavigationFailedEventHandler(object sender, NavigationFailedEventArgs e);
Public Delegate Sub NavigationFailedEventHandler(sender As Object, e As NavigationFailedEventArgs)

Parameters

sender
Object

Platform::Object

IInspectable

The object where the handler is attached.

e
NavigationFailedEventArgs

Event data for the event.

Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Examples

The following code example demonstrates the use of the NavigationFailed event.

void webViewA_NavigationFailed(object sender, NavigationFailedEventArgs e)
{
    var dialog = new Windows.UI.Popups.MessageDialog();
    dialog.Title = "Navigation Failed";
    dialog.Content = String.Format("Could not navigate to {0}, Reason: {1}", 
        e.SourcePageType.ToString(), e.Exception.Message);
    dialog.ShowAsync();
}

Applies to