다음을 통해 공유


InkCanvas.IsGestureRecognizerAvailable 속성

정의

사용자의 시스템에서 제스처 인식 구성 요소를 사용할 수 있는지 확인합니다.

public:
 property bool IsGestureRecognizerAvailable { bool get(); };
public bool IsGestureRecognizerAvailable { get; }
member this.IsGestureRecognizerAvailable : bool
Public ReadOnly Property IsGestureRecognizerAvailable As Boolean

속성 값

Boolean

인식 구성 요소를 사용할 수 있으면 true이고, 그렇지 않으면 false입니다.

예제

다음 예제에서는 구성 하는 방법에 설명 된 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

적용 대상