I want to print a WebView contents inside a UWP app.
I've set up my WebView to accept an HTML string, and this works fine:
<WebView
ext:HtmlExtension.HtmlString="{Binding HtmlString}"
x:Name="MyWebView"
Grid.Row="1"
Grid.Column="0"
/>
I noticed this though on MSDN:
A WebView that hosts content off the UI thread is not compatible with parent controls that require gestures to propagate up from the WebView control to the parent, such as FlipView, ScrollViewer, and other related controls. These controls will not be able to receive gestures initiated in the off-thread WebView. In addition, printing off-thread web content is not directly supported – you should print an element with WebViewBrush fill instead.
Now I'm completely confused.
Can someone please explain how I can:
- Create a WebViewBrush given I have a WebView
- How to then print this WebViewBrush
Any help is greatly appreciated. Thanks.