我正在使用滾動查看器顯示內容,並向滾動查看器添加了「DoubleTap」事件。在doubleTap事件中,我想讓scrollviewer自動滾動到scrollviewer的頂部,但我找不到任何屬性來控制scrollviewer。有什麼想法嗎?如何在Windows Phone中控制滾動查看器的滾動位置
在此先感謝。
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="0,0,0,0">
<ScrollViewer x:Name="scrollViewer2" Height="auto">
<toolkit:GestureService.GestureListener>
<toolkit:GestureListener DoubleTap="GestureListener_DoubleTap"/>
</toolkit:GestureService.GestureListener>
<StackPanel x:Name="stackPanel2" Height="auto">
<!--contents-->
</StackPanel>
</ScrollViewer>
</Grid>
謝謝,它的工作原理。 – ellic 2012-01-08 11:08:42
請注意,偏移量與要滾動的ListBoxItem的索引相關,而不是像素值。它被存儲爲雙重的,例如, 5.83會滾動到第5項和第6項之間的位置。 – Stonetip 2012-02-08 16:51:13