DragDrop.DragLeave 연결된 이벤트

정의

이 이벤트는 개체를 놓기 대상의 역할을 하는 요소 경계 밖으로 놓지는 않고 끄는 동안 발생합니다.

see AddDragLeaveHandler, and RemoveDragLeaveHandler
see AddDragLeaveHandler, and RemoveDragLeaveHandler
see AddDragLeaveHandler, and RemoveDragLeaveHandler

예제

다음 예제에서는 Ellipse 요소에 대한 DragLeave 이벤트 처리기를 보여 줍니다. 이 코드에서는 저장된 Brush를 타원에 적용하여 DragEnter 이벤트 처리기에서 수행한 미리 보기를 실행 취소합니다.

private void ellipse_DragLeave(object sender, DragEventArgs e)
{
    Ellipse ellipse = sender as Ellipse;
    if (ellipse != null)
    {
        ellipse.Fill = _previousFill;
    }
}
Private Sub Ellipse_DragLeave(ByVal sender As System.Object, ByVal e As System.Windows.DragEventArgs)
    Dim ellipse = TryCast(sender, Ellipse)
    If ellipse IsNot Nothing Then
        ellipse.Fill = _previousFill
    End If
End Sub

설명

이 이벤트는 개체가 삭제되지 않고 놓기 대상 역할을 하는 요소의 범위 밖으로 끌 때마다 한 번씩 발생합니다. 요소의 AllowDrop 속성 false이 이면 이 이벤트가 발생하지 않습니다.

일반적으로 이 이벤트를 처리하여 이벤트 처리기에서 DragEnter 변경한 내용을 실행 취소합니다.

라우팅 이벤트 정보

식별자 필드 DragLeaveEvent
라우팅 전략 버블링
대리자 DragEventHandler

해당 터널링 이벤트가 PreviewDragLeave합니다.

적용 대상

추가 정보