InkCanvas.Gesture 이벤트
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
InkCanvas에서 제스처가 감지될 때 발생합니다.
public:
event System::Windows::Controls::InkCanvasGestureEventHandler ^ Gesture;
public event System.Windows.Controls.InkCanvasGestureEventHandler Gesture;
member this.Gesture : System.Windows.Controls.InkCanvasGestureEventHandler
Public Custom Event Gesture As InkCanvasGestureEventHandler
이벤트 유형
예제
다음 예제에서는 설정 하는 방법을 보여 줍니다는 InkCanvas 애플리케이션 제스처를 인식 하도록 합니다.
// Add this code to the contstructor or OnLoaded method.
if (inkCanvas1.IsGestureRecognizerAvailable)
{
inkCanvas1.EditingMode = InkCanvasEditingMode.InkAndGesture;
inkCanvas1.Gesture += new InkCanvasGestureEventHandler(inkCanvas1_Gesture);
inkCanvas1.SetEnabledGestures(new ApplicationGesture[]
{ApplicationGesture.Down,
ApplicationGesture.ArrowDown,
ApplicationGesture.Circle});
}
' Add this code to the contstructor or OnLoaded method.
If (inkCanvas1.IsGestureRecognizerAvailable) Then
inkCanvas1.EditingMode = InkCanvasEditingMode.InkAndGesture
Dim gestures() As ApplicationGesture = _
{ApplicationGesture.Down, _
ApplicationGesture.ArrowDown, _
ApplicationGesture.Circle}
inkCanvas1.SetEnabledGestures(gestures)
End If
void inkCanvas1_Gesture(object sender, InkCanvasGestureEventArgs e)
{
ReadOnlyCollection<GestureRecognitionResult> gestureResults =
e.GetGestureRecognitionResults();
// Check the first recognition result for a gesture.
if (gestureResults[0].RecognitionConfidence ==
RecognitionConfidence.Strong)
{
switch (gestureResults[0].ApplicationGesture)
{
case ApplicationGesture.Down:
// Do something.
break;
case ApplicationGesture.ArrowDown:
// Do something.
break;
case ApplicationGesture.Circle:
// Do something.
break;
}
}
}
Sub inkCanvas1_Gesture(ByVal sender As Object, _
ByVal e As InkCanvasGestureEventArgs) Handles inkCanvas1.Gesture
Dim gestureResults As ReadOnlyCollection(Of GestureRecognitionResult)
gestureResults = e.GetGestureRecognitionResults()
' Check the first recognition result for a gesture.
If gestureResults(0).RecognitionConfidence = _
RecognitionConfidence.Strong Then
Select Case gestureResults(0).ApplicationGesture
Case ApplicationGesture.Down
' Do something.
Case ApplicationGesture.ArrowDown
' Do something.
Case ApplicationGesture.Circle
' Do something.
End Select
End If
End Sub
설명
라우팅 이벤트 정보
식별자 필드 | GestureEvent |
라우팅 전략 | 버블링 |
대리자 | InkCanvasGestureEventHandler |