Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebBrowser control in UWP (Windows 10) XAML

Can you tell me how can I provide a browser control in Windows 10 (WUP) XAML? When I'm using WebControl I'm getting a compile error that says

WebBrowser is not supported in a Windows Universal project.

I have to show an "external" website, not a static HTML resource.

like image 202
llasarov Avatar asked Oct 25 '15 21:10

llasarov


People also ask

What is XAML control?

The XAML User Interface framework offers an extensive library of controls that supports UI development for Windows. Some of them have a visual representation such Button, Textbox, TextBlock, etc.; while other controls are used as containers for other controls or content, for example, images.

What is WebView control?

WebView is a view that display web pages inside your application. You can also specify HTML string and can show it inside your application using WebView. WebView makes turns your application to a web application. In order to add WebView to your application, you have to add <WebView> element to your xml layout file.

What is WPF with WebView?

The WebView control shows web content in your Windows Forms or WPF desktop application. This is one of several wrapped Universal Windows Platform controls that are available for Windows Forms and WPF applications. For more information, see UWP controls in desktop applications.


1 Answers

Universal Windows apps in Xaml use the Windows.UI.Xaml.Controls.WebView to display HTML content.

Xaml:

<WebView Source="http://stackoverflow.com" />

From code:

 myWebView.Source = new Uri("http://stackoverflow.com");
like image 98
Rob Caplan - MSFT Avatar answered Oct 06 '22 23:10

Rob Caplan - MSFT