2011-04-15 33 views
0

如何防止Windows Phone 7在用戶滾動時向我的網格(我用作按鈕)發送MouseLeftButtonUp事件?阻止手機在滾動時發送MouseLeftButtonUp事件

此問題有時會導致在用戶滾動時導航到另一個頁面。

或者我應該爲此使用按鈕模板?

示例代碼:

<ScrollViewer> 
    <StackPanel> 
     <Grid x:Name="Button1" MouseLeftButtonUp="Button1_LeftMouseButtonUp"> 
      <TextBlock Margin="12 15" /> 
     </Grid> 
    </StackPanel> 
</ScrollViewer> 
+0

你有沒有找到一個解決這個? – 2011-05-17 04:21:59

+0

我用ControlTemplate代替了一個按鈕。 – Ehssan 2012-06-13 15:00:28

回答

0

相反LeftMouseButtonUp事件試試這個

private void Button1_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e) 
{ 
    if (!e.IsInertial) 
    { 
     //Button Click Code 
    } 
}