当前位置: 动力学知识库 > 问答 > 编程问答 >

silverlight - Prevent phone from sending MouseLeftButtonUp event while scrolling

问题描述:

How can I prevent the windows phone 7 from sending a MouseLeftButtonUp-event to my Grid (that I use as Button) while the user is scrolling?

This issue sometimes leads to a navigation to another page just when the user scrolling.

Or should I use a Button-Template for this?

Example code:

<ScrollViewer>

<StackPanel>

<Grid x:Name="Button1" MouseLeftButtonUp="Button1_LeftMouseButtonUp">

<TextBlock Margin="12 15" />

</Grid>

</StackPanel>

</ScrollViewer>

网友答案:

Instead of LeftMouseButtonUp event try this

private void Button1_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
{
    if (!e.IsInertial)
    {
        //Button Click Code
    }
}
分享给朋友:
您可能感兴趣的文章:
随机阅读: