【发布时间】:2014-07-25 11:09:03
【问题描述】:
我有一个带有 2 个 PivotItems 的 Pivot。我正在尝试检测用户是向左还是向右滑动。我想我可以通过检查 ManipulationStarted 和 ManipulationCompleted 点之间的差异来检测到这一点。但无论我做什么,这些事件都不会被触发。
<Pivot x:Name="albumart_pivot" Margin="0,-30,0,0" ManipulationStarted="ManipulationStartedEvent" ManipulationCompleted="ManipulationCompletedEvent" ManipulationMode="TranslateX">
<PivotItem Margin="0">
<Grid>
<Rectangle Canvas.ZIndex="1" Fill="White" Opacity="0.1" Margin="20"/>
<Image x:Name="albumart0" Stretch="UniformToFill" Canvas.ZIndex="1" Source="{Binding albumart}" Margin="20" Height="{Binding screenwidth}" Width="{Binding screenwidth}" ManipulationStarted="albumart_pivot_ManipulationStarted" ManipulationCompleted="albumart_pivot_ManipulationCompleted"/>
</Grid>
</PivotItem>
<PivotItem Margin="0">
<Grid>
<Rectangle Canvas.ZIndex="1" Fill="White" Opacity="0.1" Margin="20"/>
<Image x:Name="albumart1" Stretch="UniformToFill" Canvas.ZIndex="1" Source="{Binding albumart}" Margin="20" Height="{Binding screenwidth}" Width="{Binding screenwidth}" ManipulationStarted="albumart_pivot_ManipulationStarted" ManipulationCompleted="albumart_pivot_ManipulationCompleted"/>
</Grid>
</PivotItem>
</Pivot>
我也尝试过检测指针。 PointerEntered 事件确实会被触发,但 PointerExited/PointerReleased/PointerCanceled 不会...
【问题讨论】:
-
你想做什么?
标签: c# windows-phone-8 pivot windows-phone-8.1