locked
How can I prevent flickering when using the WebView and WebViewBrush in XAML/C# Metro app?

    Question

  • I have a WebView and, following the MSDN guidance, I have a WebViewBrush rendered via a Rectangle so that the WebView properly fits in the Z-order of my app when the appbar or app settings are displayed. However, when swapping to and from the WebViewBrush rectangle, there is a noticeable flickering, which has been raised as an issue during my app certification.

    I have implemented this according to MSDN guidance and I have tried various other configurations but the flicker remains in all circumstances. I believe this is a bug in WinRT for XAML-based apps, but I need help confirming this as right now, my app is failing cert and this is one of the issues it fails on.

    Has anyone else seen this? Is it a WinRT bug or am I perhaps doing it wrong? 

    Please see the example code here to see how I have implemented this (imagine that I have used appbar open/close events instead of ComboBox-related events).


    • Edited by J Yates Monday, July 09, 2012 1:17 PM additional context
    Monday, July 09, 2012 1:15 PM

Answers

  • We have a bug already filed for this problem.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    Monday, July 09, 2012 2:30 PM
    Moderator

All replies

  • We have a bug already filed for this problem.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    Monday, July 09, 2012 2:30 PM
    Moderator
  • Will it be fixed for RTM?
    Monday, July 09, 2012 3:30 PM
  • I'm experiencing the same issues, hopefully it will be fixed in RTM version. 

    Cmpi1in9 it..


    • Edited by gaurav77 Monday, July 09, 2012 5:17 PM
    Monday, July 09, 2012 5:17 PM
  • As in life, there are no guarantees.  But the eight ball says "Probably".

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    Monday, July 09, 2012 5:21 PM
    Moderator
  • I've just bumped into this in the latest release and it still flickers badly.  Is there any workaround yet?

    Anthony Wieser | Wieser Software Ltd | www.wieser-software.com

    Tuesday, October 16, 2012 11:31 AM
  • Found a solution based on this site:

    http://cggallant.blogspot.co.uk/2012/09/windows-8-windows-store-apps-and.html

    In my case, I do this when notified that the flyout is about to open:

    var wbv = new WebViewBrush();
    wbv.SetSource(webview);
    
    // now set up my rectangle, webviewsnapshot
    webviewsnapshot.Opacity = 1;
    webviewsnapshot.Fill = wbv;
    webviewsnapshot.Visibility = Visibility.Visible;
    
    // now update the control while the webview is still visible
    this.UpdateLayout();
    
    await Task.Delay(200);
    
    // finally make the web view disappear
    webview.Visibility = Visibility.Collapsed;


    Anthony Wieser | Wieser Software Ltd | www.wieser-software.com

    Tuesday, October 16, 2012 11:54 AM
  • Hello,

    I'm working at Matrix and trying to solve a flicker of this kind but to no avail. Although I've tried using both your method and the method of C. Gerard Gallant (the guy from you link), the only thing that came out of this is an improvement in the flicking duration (down to about 250ms or so). trouble is that it's not consistent and the flicker can sometimes last longer.

    Might you (or anyone else) have another idea for handling this situation ?

    Thursday, May 16, 2013 1:06 PM