WebView.UnviewableContentIdentified WebView.UnviewableContentIdentified WebView.UnviewableContentIdentified WebView.UnviewableContentIdentified Event


Occurs when the WebView attempts to download an unsupported file.

public : event TypedEventHandler UnviewableContentIdentified<WebView, WebViewUnviewableContentIdentifiedEventArgs>
// Register
event_token UnviewableContentIdentified(TypedEventHandler<WebView, WebViewUnviewableContentIdentifiedEventArgs> const& handler) const;

// Revoke with event_token
void UnviewableContentIdentified(event_token const& cookie) const;

// Revoke with event_revoker
UnviewableContentIdentified_revoker UnviewableContentIdentified(auto_revoker_t, TypedEventHandler<WebView, WebViewUnviewableContentIdentifiedEventArgs> const& handler) const;
public event TypedEventHandler UnviewableContentIdentified<WebView, WebViewUnviewableContentIdentifiedEventArgs>
Public Event TypedEventHandler UnviewableContentIdentified(Of WebView, WebViewUnviewableContentIdentifiedEventArgs)
<WebView UnviewableContentIdentified="eventhandler" />


The following code example demonstrates how to handle this event to launch an external browser when the WebView control cannot render the target content. For the complete example, see the XAML WebView control sample.

void webView1_UnviewableContentIdentified(WebView sender, 
    WebViewUnviewableContentIdentifiedEventArgs args)
    appendLog(String.Format("Content for \"{0}\" cannot be loaded into webview. " +
        "Invoking the default launcher instead.\n", args.Uri.ToString()));

    // We turn around and hand the Uri to the 
    // system launcher to launch the default handler for it.
    Windows.Foundation.IAsyncOperation<bool> b = 
    pageIsLoading = false;


The WebView control cannot host arbitrary file types, but you can handle this event and use the Launcher class to redirect the file to the browser or another app.

See Also