【发布时间】:2011-11-30 13:06:10
【问题描述】:
当我点击并按住并移动我的列表时,它会移动,但当我不再按住时,它会平滑地滚动回列表的开头。如何预防?
我还尝试将整个 ItemsControl 放入 ScrollViewer - 相同的行为。
如果没有 ScrollViewer,ItemsControl 根本不会滚动。
我为 ItemsPresenter、ItemsControl 和 ScrollViewer 的 ManipulationCompleted 设置了断点 - 在所有这些中,滚动出现在我离开它的正确位置,但之后它会在某个地方滚动回来。
这是我的 xaml 标记:
<Grid x:Name="LayoutRoot">
<ItemsControl Name="lbDeployments"
ItemsSource="{Binding Path=Deployments}"
ItemTemplate="{StaticResource DeploymentItem}" >
<ItemsControl.Template>
<ControlTemplate TargetType="ItemsControl">
<Grid>
<ScrollViewer>
<ItemsPresenter />
</ScrollViewer>
</Grid>
</ControlTemplate>
</ItemsControl.Template>
</ItemsControl>
</Grid>
请帮忙
【问题讨论】:
-
将 Grid 放入 ScrollViewer 也没有帮助
-
ItemsControl with ScrollViewer is not virtualizing => 可能导致性能不佳...
标签: silverlight xaml windows-phone-7 itemscontrol scrollviewer