WebViewExtensions

The WebViewExtensions allows attaching HTML content to WebView.

Platform APIs: WebViewExtensions

Syntax

Here is how the WebViewExtensions properties can be used in XAML:

<!-- Attach HTML content directly to a WebView -->
<WebView
    xmlns:ui="using:Microsoft.Toolkit.Uwp.UI"   
    ui:WebViewExtensions.Content="{Binding HtmlContent}" />

<!-- Attach a Uri directly to a WebView -->
<WebView
    xmlns:ui="using:Microsoft.Toolkit.Uwp.UI"
    ui:WebViewExtensions.ContentUri="{Binding ContentUri}" />

Note

In this example, the classic binding syntax is used, but the faster {x:Bind} syntax is supported as well. You're free to pick which one to use depending on your use case scenario.

Examples

You can find more examples in the unit tests.