积极答复者
如何实现手势能在ListView上左右滑动且不能改变选中项

问题
-
<Grid x:Name="gridList">
<ListView
x:Name="listItemListView"
AutomationProperties.AutomationId="ListItemListView"
AutomationProperties.Name="Items"
Grid.Row="1"
Margin="15,0,15,15"
Width="auto"
ScrollViewer.HorizontalScrollMode="Disabled"
VirtualizingStackPanel.VirtualizationMode="Standard"
ItemTemplate="{StaticResource ListDataItemTemplate}"
ItemContainerStyle="{StaticResource ListDataItemContainerStyle}"
ItemClick="listItemListView_ItemClick"
IsItemClickEnabled="True"
SelectionMode="Single"
IsDoubleTapEnabled="False"
IsSwipeEnabled="True">private void gridList_ManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e)
{
_slideStartPosition = e.Position;
}
private void gridList_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{currentpoint.X - _slideStartPosition.X >= 100
}
点击的时候,手动设置Selectitem=item
设置IsSwipeEnabled = false,就触发不到Manipulation事件,
如果设置IsSwipeEnabled = true,这样能触发到事件,但是滑动的时候会选中项目
我只需要点击的时候选中,滑动的时候不选中
- 已编辑 Venlentinee 2013年4月23日 0:56
答案
全部回复
-
Hi,
我试了一下,IsSwipeEnabled=false的确没有办法触发Manipulation 横向滑动一般来说是取消选择.抱歉,我没有什么好的办法防止这两个冲突.
Aaron
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.