0

Good time of day!

I have a webview control in Windows 10 UWP project. When user opens some details page his saw the webview which navigated to the local html string.

I need to say webview don't load any data from the internet (such as images, videos, flash and other content). I want just to show the HTML string.

Webview always load all content, how I can override this logic?

SYL
  • 337
  • 4
  • 16
  • SYL, you need to add the codes so we would know what is wrong. But I have a big hunch that in your details page Webview, You don't have any HTML tagging or even XML tagging. Just plain image source or embedded Vidplayer locaton. But we can't tell yet, you have to provide us the code. – Aizen Feb 02 '16 at 10:14
  • @Aizen, In my case I have an HTML document which loaded from the web. The document can contains any nedia data as videos, flash, images etc. I need to show this document to user by webview control, but if user use metered connection I need to say webview DON'T LOAD ANY DATA from the internet, just show string content. How can I do this? – SYL Mar 17 '16 at 13:34

1 Answers1

2

You can distinguish if your internet is celular data or Wifi, like this :

var connectionProfile = Windows.Networking.Connectivity.NetworkInformation.GetInternetConnectionProfile();

if (connectionProfile.IsWlanConnectionProfile)
{
     // It's wireless
     // You can load images, videos, etc. (your business here).
}
else if (connectionProfile.IsWwanConnectionProfile)
{  
     // It's mobile.
     // You'll probably want to perform some handling 
     // to inform the user that your items are not loaded 
     // because they're using a metered connection.
}

The answer is from here, where this question was initially answered.

Community
  • 1
  • 1
VasileF
  • 2,856
  • 2
  • 23
  • 36