共用方式為


NavigationFailedEventHandler 代理人

定義

表示將處理 WebView.NavigationFailedFrame.NavigationFailed 事件的方法。

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)

參數

sender
Object

Platform::Object

IInspectable

附加處理常式的物件。

e
NavigationFailedEventArgs

事件的事件資料。

屬性

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

範例

下列程式碼範例示範 使用 NavigationFailed 事件。

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();
}

適用於