Skip to content

Latest commit

 

History

History
35 lines (25 loc) · 1.34 KB

WebViewExtensions.md

File metadata and controls

35 lines (25 loc) · 1.34 KB
title author description keywords
WebViewExtensions
nmetulev
The WebViewExtensions class allows attaching HTML content to a WebView control through XAML directly or through a binding
windows 10, uwp, windows community toolkit, uwp community toolkit, uwp toolkit, WebViewExtensions, webview, extensions

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.