开发者

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开发者_StackOverflow中文版 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
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜