

The second bit is to hide the WebView control until it's been initialized by rendering it hidden or collapsed: // assign host form/control backgroundĮditorWebBrowser.DefaultBackgroundColor = WindowUtilities.BrushToColor(Background) ĮditorWebBrowser.Visibility = Visibility.Hidden It mostly works but as I'll show there are some exceptions that cause the white flash. The first step is to set the DefaultBackgroundColor which lets you apply a background color that the control internally uses before it renders any content - well is supposed to anyway. The good news is that the WebView team has made some progress on minimizing startup flashing, via the DefaultBackground property that is applied by the control before it renders, and some timing improvements that allow you make the control visible just a little sooner than you used to get requested background color set. You can see the flashing occur when pages are first loaded, and then also when tabs are changed even though the WebView controls are already initialized and hold rendered content. In this screenshot the editors on the left and the preview on the right are all WebView2 controls. To give you an idea how annoying this is, here's what I see in Markdown Monster with unmitigated WebView controls loaded onto the TabControl pages (editor and preview are WebViews): The problem is that using the WebView without any mitigations - especially when using dark backgrounds - you'll find that you get a lot of nasty UI 'white' flashes caused by the WebView's internal blank control state.
#WEST WIND WEB SURG CHECKSITE ERROR FULL#
In Markdown Monster each open document runs in its own WebView2 control (so it can maintain full editor and UI state) and you can switch between the documents via the tabs. One of the biggest issues I've been running into with the new Edge WebView2 control in WPF is that the control's rendering has some serious issues with flashing a blank control surface before loading and also when switching a UI context, such as when opening or switching to tabs with a WebView on them.
