Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/windows-phone-8/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows phone 8 ScrollViewer不会滚动到VerticalOffset_Windows Phone 8_Windows Phone - Fatal编程技术网

Windows phone 8 ScrollViewer不会滚动到VerticalOffset

Windows 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

我有一个Scrollviewer,它有一个包含ExpanderViews的StackPanel

展开ExpanderView时,我正在更新ScrollViewer垂直偏移量。但是Scrollviewer根本不会向上滚动

scrollviewer滚动到垂直偏移的唯一时间是从FScrollViewer_LayoutUpdated方法中开始的。这与ScrollViewer的LayoutUpdated事件有关

是否有任何方法可以从其他方法更新VerticalOffset或ScrollToVerticalOffset

<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的实际高度。这可能会导致问题,因为在尝试最初滚动时,范围可能不够大。