Is WriteableBitmapRenderExtensions.Render not supported for WebView Control

Sep 6, 2013 at 2:21 PM
Hi,

In our app, we have a scenario where there is a webView control on the page and a popup should be displayed over the webView control. But due to "airspace problem", webView is overlapping with popup. Here we are not in a position to alter app design to use other controls instead of browser. So as a workaround we tried following:
    async void ShowPopupAsync()
    {
        var fe = _webView as FrameworkElement;
        var bitmap = await WriteableBitmapRenderExtensions.Render(fe);

        _screenShotImage.Source = bitmap;
        _screenShotImage.Height = fe.ActualHeight;
        _screenShotImage.Width = fe.ActualWidth;

        _screenShotImage.Visibility = Visibility.Visible;
        fe.Visibility = Visibility.Collapsed;
        _popup.IsOpen = true;
    }

    void DismissPopup()
    {
        _webView.Visibility = Visibility.Visible;
        _screenShotImage.Visibility = Visibility.Collapsed;
        _popup.IsOpen = false;
    }
But the issue here is rendered bitmap is always blanc. WriteableBitmapRenderExtensions.Render is not rendering WebView Control. Is there any fix for this or any workaround.

Your help will be highly appreciated.

Thanks,
Anil
Coordinator
Sep 6, 2013 at 4:41 PM
WriteableBitmapRenderExtensions don't support WebView, but you should use the WebViewBrush that comes with the base Windows Runtime.