Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebView inside ScrollViewer with XAML element header

In WebView I load HTML elements with WP 8.1. Whenever content exceeds the WebView height there is scroll without issues. My problem is that I have XAML elements in the top of the WebView, which have to scroll along with the WebView scroll.

Sourcecode:

<ScrollViewer>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid VerticalAlignment="Top" >
<StackPanel x:name="xamlelement" Margin="15 20 0 0">
<textblock/>
  -------
  -------
  -------
</StackPanel>
</Grid>
<Grid x:Name="testgrid" Grid.Row="1">
<WebView Margin="0 30 0 0"  x:Name="msgContent" >
</WebView>
</Grid>
</Grid>
</ScrollViewer>

Whenever the WebView element "msgContent" scrolls I want the stackpanel "xamlelement" to scroll along with the WebView.

like image 933
Ganapathy Avatar asked Apr 30 '15 10:04

Ganapathy


1 Answers

The problem here is we can disable webview scroll by this 2 steps

1 ) setting overhidden to html content loaded to the webview

2) setting height of webview equal to the html content loaded in it.

But then when we try to move in webview,the evnets are not passed to the parent scrollviewer element

like image 68
anand jothi Avatar answered Nov 30 '22 09:11

anand jothi