在WP 8.1中,我使用WebView加载HTML元素。每当内容超过WebView高度时,就会出现滚动条而没有问题。我的问题是,我在WebView顶部有XAML元素,这些元素必须随着WebView滚动而滚动。
源代码:
无论何时 WebView 元素 "msgContent" 滚动,我希望 stackpanel "xamlelement" 也随着 WebView 滚动。
源代码:
<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>
无论何时 WebView 元素 "msgContent" 滚动,我希望 stackpanel "xamlelement" 也随着 WebView 滚动。