Autosize WebView to its Content

Ever wanted to resize the WebView controller according to its HTML content for Windows or Windows Phone apps?

I had this same problem working on a project and solved it by determining the scroll height/width of the HTML content and setting the width of the WebView controller accordingly. I've wrapped all the necessary functionality into an extension method for easy re-use.