Stylus.StylusLeave 연결된 이벤트

정의

스타일러스 커서가 요소 범위를 벗어날 때 발생합니다.

see AddStylusLeaveHandler, and RemoveStylusLeaveHandler
see AddStylusLeaveHandler, and RemoveStylusLeaveHandler
see AddStylusLeaveHandler, and RemoveStylusLeaveHandler

예제

다음 예제에서는 스타일러스 커서가 들어와 경계를 Button 벗어나면 의 색을 변경하는 방법을 보여 줍니다. 이 예제에서는 가 호출 button1 되고 ButtonStylusEnterStylusLeave 이벤트가 이벤트 처리기에 연결되어 있다고 가정합니다.

Brush originalColor;

void button1_StylusLeave(object sender, StylusEventArgs e)
{
    button1.Background = originalColor;
}

void button1_StylusEnter(object sender, StylusEventArgs e)
{
    originalColor = button1.Background; 
    button1.Background = Brushes.Gray;
}
Private originalColor As Brush

Private Sub button1_StylusLeave(ByVal sender As Object, ByVal e As StylusEventArgs) _
    Handles button1.StylusLeave

    button1.Background = originalColor

End Sub

Private Sub button1_StylusEnter(ByVal sender As Object, ByVal e As StylusEventArgs) _
    Handles button1.StylusEnter

    originalColor = button1.Background
    button1.Background = Brushes.Gray

End Sub

설명

연결 된 이벤트입니다. WPF는 연결된 이벤트를 라우트된 이벤트로 구현합니다. 연결된 이벤트는 기본적으로 이벤트를 정의하지 않는 개체에서 처리되는 이벤트를 참조하는 데 사용되는 XAML 언어 개념입니다. WPF는 연결된 이벤트의 기능을 추가로 확장하여 경로를 트래버스할 수 있도록 합니다. 연결된 이벤트에는 코드에 직접 처리 구문이 없습니다. 코드에서 라우트된 이벤트에 대한 처리기를 연결하려면 지정된 Add*Handler 메서드를 사용합니다. 자세한 내용은 참조 하세요 연결 된 이벤트 개요합니다.

라우팅 이벤트 정보

식별자 필드 StylusLeaveEvent
라우팅 전략 직접
대리자 StylusEventHandler

적용 대상

추가 정보