Equivalent of CEF's OnLoadingStateChange in WebView2

679 views Asked by At

In my WPF application that hosts the WebView2 control, I want to keep a track on the loading state of my browser just like how 'OnloadingStateChange' does in CEF.

How can i achieve the same thing in WebView2 ?

1

There are 1 answers

0
David Risney On

The CoreWebView2.NavigationStarting event is dispatched before the top level document of the WebView2 navigates to a new URI and CoreWebView2.NavigationCompleted is dispatched after that navigation fails or the document loads. Here's info on WebView2 navigation events.

From the WPF WebView2 control you can use the CoreWebView2 property to find all navigation events. The CoreWebView2 property is available after the WebView2 is initialized.

Diagram of WebView2 navigation event state diagram.