解決事件重複觸發的問題:
private void Close_TouchDown(object sender, TouchEventArgs e) { e.Handled = true; FrameworkElement element = sender as FrameworkElement; element.CaptureTouch(e.TouchDevice); }
private void Close_TouchUp(object sender, TouchEventArgs e) { // 將動作事件寫在 TouchUp e.Handled = true; Hide(); }
這樣就能防止前面控制項關閉或隱藏,但又影響到後面控制項的問題
參考資料: http://stackoverflow.com/questions/11600146/simulate-tap-in-wpf-using-windows-7-touch-framework
全站熱搜
留言列表