2012-10-15 5 views
1

나는 약 GestureRecognizer에 대한 지침을 msdn 따라 왔습니다! 핀치 손님 취급. 그러나 ManipulationUpdated 전화를받을 수 없습니다. 제가 빠진 것이 있습니까? 내 포인터 이벤트에서Windows 스토어 앱 핀치 확대/축소 처리

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); 
    } 

답변

0

시도 제스처 설정에서 모든 플래그에 URN 내 생성자에서 내 C# 클래스에서

,

`private GestureRecognizer gesture = new GestureRecognizer();` 

재산. 내 링크에 설명 된대로 :

gesture.gestureSettings = 
     Windows.UI.Input.GestureSettings.manipulationRotate | 
     Windows.UI.Input.GestureSettings.manipulationTranslateX | 
     Windows.UI.Input.GestureSettings.manipulationTranslateY | 
     Windows.UI.Input.GestureSettings.manipulationScale | 
     Windows.UI.Input.GestureSettings.manipulationRotateInertia | 
     Windows.UI.Input.GestureSettings.manipulationScaleInertia | 
     Windows.UI.Input.GestureSettings.manipulationTranslateInertia | 
     Windows.UI.Input.GestureSettings.tap;