と私はPointerWheelChanged
イベント(マウスやタッチパッドからの水平スクロールを処理するため)にManipulationDelta
またはManipulationUpdated
とManipulationCompleted
を扱いたいUWPアプリケーションを、持っています。 PointerwheelChanged
イベントでプロセスPointerWheelChangedイベントはGestureRecognizer
、私はe
がPointerRoutedEventArgs
ある
gesture.ProcessMouseWheelEvent(e.GetCurrentPoint(this), false,false);
でこれを管理しています。
コードスニペット:
GestureRecognizer gesture = new GestureRecognizer();
gesture.ManipulationCompleted += OnManipulationCompleted;
gesture.ManipulationUpdated += OnManipulationUpdated;
void OnManipulationUpdated(object sender, ManipulationUpdatedEventArgs e)
{
//Ideally this Should be called whenever there is a change in manipulation
}
void OnManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
{
//Code for Scroll
//Ideally this has to be called on completion of Manipulation Event(Correct me if am wrong)
}
private void onPointerwheelChanged(object sender, PointerRoutedEventArgs e)
{
gesture.ProcessMouseWheelEvent(e.GetIntermediatePoints((this) sender)[0], false, false);
}
onPointerwheelChangedイベントが発生するたびに、このアプローチの問題は、ManipulationCompleted
はあまりにも(指がタッチパッド全体に接触していた自分がタッチパッドに単一の長いスライドを実行するにもかかわらず、解雇されますスライドを通して)。
1つのロングスライドの最後で、1つのManipulationCompleted
イベントがトリガーされるのが理想的です。しかし、複数のManipulationCompleted
イベントがトリガーされています。
この問題を避ける方法はありますか? GestureRecognizer
に火をつけるManipulationCompleted
スライドの最後にイベントがありますか? onPointerwheelChanged
イベントが発生するたびに
こんにちは!優れた質問。具体的に何が起こっているかを見ることができるように、あなたのコードを含めてください。私たちはそれなしではデバッグできません。ありがとう –
あなたの質問にあなたのコードを追加する必要があります。あなたは、人々が –
更新のポストに答えるという質問をする方法の詳細情報が必要な場合はhttp://stackoverflow.com/help/how-to-askを参照してください! – Highbrow