问题描述:

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
    }
}
相关阅读:
Top