GestureRecognizer に関するmsdnの指示に従いました。ピンチゲスチャー対応用。しかし、私はManipulationUpdated
呼ばれることができません。足りないものはありますか?
私のC#
クラスでは、
`private GestureRecognizer gesture = new GestureRecognizer();`
私のコンストラクタで:
gesture.GestureSettings = GestureSettings.ManipulationScale;
gesture.ManipulationUpdated += gesture_ManipulationUpdated;
gesture.ManipulationStarted += gesture_ManipulationStarted;
gesture.ManipulationCompleted += gesture_ManipulationCompleted;
私のポインターイベントでは:
private void PointerPressed_1(object sender, PointerRoutedEventArgs e)
{
var point = e.GetIntermediatePoints(null);
gesture.ProcessDownEvent(point[0]);
}
private void PointerMoved_1(object sender, PointerRoutedEventArgs e)
{
gesture.ProcessMoveEvents(e.GetIntermediatePoints(null));
}
private void PointerReleased_1(object sender, PointerRoutedEventArgs e)
{
var point = e.GetIntermediatePoints(null);
gesture.ProcessUpEvent(point[0]);
gesture.CompleteGesture();
}
void gesture_ManipulationCompleted(GestureRecognizer sender, ManipulationCompletedEventArgs args)
{
System.Diagnostics.Debug.WriteLine("Manipulation Completed {0}", args.Cumulative.Scale);
}
void gesture_ManipulationStarted(GestureRecognizer sender, ManipulationStartedEventArgs args)
{
System.Diagnostics.Debug.WriteLine("Manipulation Started {0}", args.Cumulative.Scale);
}
void gesture_ManipulationUpdated(GestureRecognizer sender, ManipulationUpdatedEventArgs args)
{
System.Diagnostics.Debug.WriteLine("Manipulation Updated {0}", args.Cumulative.Scale);
}