title: Windows Phone 8.1 - Handle WebView vertical scroll by outer ScrollViewer element
body: <h2>Problem</h2>
  
  <p>I have to show a <code>WebView</code> inside a <code>ScrollViewer</code> in Windows Phone 8.1 application, with the following requirements:</p>
  
  <ol>
  <li><code>WebView</code> height should be adjusted based on its content. </li>
  <li><code>WebView</code> vertical scroll should be handled by an outer <code>ScrollViewer</code>.</li>
  <li><code>WebView</code> should handle horizontal scroll, scale (pinch-zoom), text selection (with the default copy button) and links navigation.</li>
  </ol>
  
  <p>On the picture below is my mocked layout (to the left) and the best example of similar functionality - that would be a built-in mail application (to the right)</p>
  
  <p><img src="https://i.stack.imgur.com/jupPQ.png" alt="My page layout (to the left) and example of similar functionality (to the right)"></p>
  
  <p>Sample XAML layout:</p>
  
  <pre><code>&lt;ScrollViewer&gt;
      &lt;Grid Margin="12"&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="Auto"/&gt;
              &lt;RowDefinition Height="*"/&gt;
          &lt;/Grid.RowDefinitions&gt;
          &lt;Grid Grid.Row="0"&gt;
              &lt;TextBlock Text="My content" /&gt;
          &lt;/Grid&gt;
          &lt;WebView Grid.Row="1" x:Name="WebViewComponent"&gt;&lt;/WebView&gt;
      &lt;/Grid&gt;
  &lt;/ScrollViewer&gt;
  </code></pre>
  
  <h2>What did I try</h2>
  
  <p><a href="https://stackoverflow.com/questions/12727041/detecting-webview-height-via-scrolling-in-xaml">Measure HTML content and adjusting the WebView height</a> - This part <strong>worked</strong> and with several adjustments I was able to set the correct height to the <code>WebView</code> element.</p>
  
  <p><a href="https://stackoverflow.com/questions/16787331/windows-phone-avoid-scrolling-of-web-browser-control-placed-inside-scroll-view">Subscribing to a Border element inside a WebView</a> - <strong>Did not work</strong>. The problem here is that in Windows Phone 8.1 it seems that a <code>WebView</code> component does not have visual children (at least not <code>DependencyObject</code>'s)</p>
  
  <p>As well I've tried playing around with <code>ManupulationMode</code> and <code>IsHitTestVisible</code> properties with <strong>no success</strong>.</p>
  
  <p><strong>UPDATE</strong>
  Added text selection &amp; copy button to required <code>WebView</code> functionality. Somehow missed it in the original question content.</p>