Windows phone 8 ScrollViewer不会滚动到VerticalOffset
我有一个Scrollviewer,它有一个包含ExpanderViews的StackPanel 展开ExpanderView时,我正在更新ScrollViewer垂直偏移量。但是Scrollviewer根本不会向上滚动 scrollviewer滚动到垂直偏移的唯一时间是从FScrollViewer_LayoutUpdated方法中开始的。这与ScrollViewer的LayoutUpdated事件有关 是否有任何方法可以从其他方法更新VerticalOffset或ScrollToVerticalOffsetWindows phone 8 ScrollViewer不会滚动到VerticalOffset,windows-phone-8,windows-phone,Windows Phone 8,Windows Phone,我有一个Scrollviewer,它有一个包含ExpanderViews的StackPanel 展开ExpanderView时,我正在更新ScrollViewer垂直偏移量。但是Scrollviewer根本不会向上滚动 scrollviewer滚动到垂直偏移的唯一时间是从FScrollViewer_LayoutUpdated方法中开始的。这与ScrollViewer的LayoutUpdated事件有关 是否有任何方法可以从其他方法更新VerticalOffset或ScrollToVertical
<Grid x:Name="FilterGrid" Height="696" Grid.Row="0" Background="White">
<Grid.Projection>
<PlaneProjection/>
</Grid.Projection>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<ScrollViewer x:Name="FScrollViewer" toolkit:TiltEffect.SuppressTilt="True" LayoutUpdated="FScrollViewer_LayoutUpdated"
MouseMove="FScrollViewer_MouseMove" Width="{Binding ElementName=FilterGrid, Path=ActualWidth}" Height="{Binding ElementName=FilterGrid, Path=ActualHeight}" >
<StackPanel Name="StackPanel" Margin="50,0,0,0" >
<StackPanel x:Name="Header" Height="65" Orientation="Horizontal" Background="Transparent" >
<TextBlock x:Name="HeaderTextBlock" Text="Random text" Style="{StaticResource PhoneTextTitle2Style}" TextTrimming="WordEllipsis" FontWeight="SemiBold" Foreground="Black" Margin="60,5,5,5" VerticalAlignment="Center"/>
</StackPanel>
<Line Width="Auto" StrokeThickness="1.5" Stretch="Fill" Stroke="Gray" X1="2" />
</StackPanel>
</ScrollViewer>
</Grid>
您应该能够在ScrollViewer加载后的任何时间滚动。值得注意的是,您似乎有很多不同的方法来设置ScrollViewer的高度。在一个地方,您将行定义设置为“自动”。在另一个示例中,您尝试将高度绑定到FilterGrid的实际高度。这可能会导致问题,因为在尝试最初滚动时,范围可能不够大。