Skip to content

Latest commit

 

History

History
61 lines (43 loc) · 2.05 KB

webview_navigationstarting.md

File metadata and controls

61 lines (43 loc) · 2.05 KB
-api-id -api-type
E:Windows.UI.Xaml.Controls.WebView.NavigationStarting
winrt event

Windows.UI.Xaml.Controls.WebView.NavigationStarting

-description

Occurs before the WebView navigates to new content.

-xaml-syntax

<WebView NavigationStarting="eventhandler" />

-remarks

You can cancel navigation in a handler for this event by setting the WebViewNavigationStartingEventArgs.Cancel property to true.

WebView navigation events occur in the following order:

Similar events occur in the same order for each iframe in the WebView content:

-examples

The following code example demonstrates how to handle this event to update a text box used as an address bar. For the complete example, see the XAML WebView control sample.

void webViewA_NavigationStarting(WebView sender, WebViewNavigationStartingEventArgs args)
{
    string url = "";
    try { url = args.Uri.ToString(); }
    finally
    {
        address.Text = url;
        appendLog(String.Format("Starting navigation to: \"{0}\".\n", url));
        pageIsLoading = true;
    }
}

-see-also

WebViewNavigationStartingEventArgs, XAML WebView control sample