WPF WebBrowser blank? Check your Airspace!
WPF’s WebBrowser control (and in fact, all native controls, like the Ink controls), have a pretty subtle "gotcha" that made me spend a decent amount of time pulling my hair out. The control would render as all white like it hadn’t loaded the page, yet you can still see Tooltips from the web site as you mouse over the control! Clicking on links still works, scrollbars show up, yet the control is all white! What gives?!
My problem has to do with Airspace; WPF completely discards the concepts that Win32 and WinForms have used to handle UI rendering in the past – all controls in WPF are "Windowless controls"; there is only one HWND allocated to the entire window, whereas Win32 windows typically have many, many HWNDs allocated (one per control). It is this "impedance mismatch" that causes a lot of tricky issues, especially with keyboard/input focus. My Window had the "AllowsTransparency" bool set, so it was being created as a layered window.
The way I solved this in my app was simply to set the AllowsTransparency property of my Window to "false". I suggested that WebBrowser should throw an Exception when it encounters this situation, and the WPF team filed a bug against it for .NET 4.0 so hopefully, this specific gotcha won’t continue into the future.
