WinRt WebView Interface Controls Navigation Inside a Control

I have a Metro application using a WebView control. I use NavigateToString to load an html file that may contain hyperlinks. What I want to do then is to detect when one of these hyperlinks is selected, and instead of allowing navigation in the WebView control, launch IE and view the page there.

Is this possible within the limits of WinRT, and if so, how?

So far I have tried to capture the WebView_LoadCompleted() event, but although it fires at the right time, I do not see any details about the URI from NavigationEventArgs .

+6
source share
1 answer

Unfortunately, this is not possible right away, because WebView does not include events such as Navigation (which were present on Windows Phone).

Fortunately, Nick Randolph (a brilliant developer of Windows Phone and Windows 8) created a workaround using an event script. He got a great blog post:

http://nicksnettravels.builttoroam.com/post/2012/04/21/Limitations-of-the-WebView-in-Windows-8-Metro-Apps.aspx

+5
source

Source: https://habr.com/ru/post/921705/


All Articles