私は、イベントのソースがタッチであるときにWPFがマウスイベントを宣伝するのを防ぐ方法を教えてください。Touchイベントの横にマウスイベントが昇格されるのはなぜですか?
私はここでe.Handled = true;
をしましたが、私は、マウスイベントがトリガ得続ける、JoshB hereの記事を読んだがJoshBはこう言われる、無操作で
タッチイベントフロー。 WPFだから
同等マウスにイベントを促進するように、タッチイベントは、未処理のされている、私は取り扱わとしてイベントをマークするために私のコードで試してみましたが、私はInkSurface
_touchSurface
に触れたら、WPFはまだマウスイベントを促進します
は、ここに私のコードです。(私はマイクロソフトのサーフェスSDKを使用していない)
_touchSurface.IsManipulationEnabled = true;
_touchSurface.TouchDown += new EventHandler<TouchEventArgs>(touchDown);
_touchSurface.TouchMove += new EventHandler<TouchEventArgs>(touchMove);
_touchSurface.TouchEnter += new EventHandler<TouchEventArgs>(touchEnter);
_touchSurface.TouchLeave += new EventHandler<TouchEventArgs>(touchLeave);
_touchSurface.ManipulationDelta += new EventHandler<ManipulationDeltaEventArgs>(ManipulationDelta);
_touchSurface.ManipulationStarting += new EventHandler<ManipulationStartingEventArgs>(ManipulationStarting);
_touchSurface.ManipulationCompleted += new EventHandler<ManipulationCompletedEventArgs>(ManipulationCompleted);
void touchDown(object sender, TouchEventArgs e)
{
e.Handled = true;
}
void touchMove(object sender, TouchEventArgs e)
{
e.Handled = true;
}
void touchLeave(object sender, TouchEventArgs e)
{
e.Handled = true;
}
void ManipulationDelta(object sender, ManipulationDeltaEventArgs e)
{
e.Handled = true;
}
void ManipulationStarting(object sender, ManipulationStartingEventArgs e)
{
e.Handled = true;
}
void ManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
{
e.Handled = true;
}
PreviewTouchDown -Upなどを試しましたか? – Silvermind
はい、私はPreviewTouchDownとPreviewTouchMoveを試しましたが、WPFはマウスイベントのプロモーションを続けています。 – simo
解決策を見つけましたか? (もしそうなら - >投稿する?) – ZSH