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.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for