WebView, oh you!

28 August 2012 · 1 minute read · xaml · facepalm

Today can only be summarized by this:

What is this, I don't even

While I’m having my fun in the dark side of development doing XAML I hit something really whacky today, using the WebView control.

Here be dragons

The WebView control seems to be a little bit special, and not really special in a good way and it seems others have also found it limiting.

But I hit an interesting problem with the WebView control rendering, in particular rendering it in a settings panel. Long story short it didn’t display.

Here’s the XAML:

<UserControl>
    <Grid>
        <WebView Source="https://www.aaron-powell.com" />
    </Grid>
</UserControl>

(I omitted the namespace guff for you)

Sure I might not be a XAML wiz but I’m pretty sure that that should work, and according to the limited knowledge of how layout works this would be fine right? My WebView doesn’t have sizes specified so it should fill out to the whole area.

Well you’re wrong. It would seem that when you use a WebView control that doesn’t have a size set on it, nor on its parents it just goes 0x0.

This coupled with the WebView’s inability to animate with the rest of the controls in its container makes leaves me just bemused.

Conclusion

Avoid the WebView control. Avoid it at all costs.


Published: 2018-05-29 16:49:01 +1000 +1000, Version: aaf7f73