DragDrop.DragLeave İliştirilmiş Olaylar
Tanım
Bir nesne, bırakılmadan bırakma hedefi olarak davranan bir öğe sınırlarının dışına sürüklendiğinde gerçekleşir.Occurs when an object is dragged out of the bounds of an element that is acting as a drop target without being dropped.
see AddDragLeaveHandler, and RemoveDragLeaveHandler
see AddDragLeaveHandler, and RemoveDragLeaveHandler
see AddDragLeaveHandler, and RemoveDragLeaveHandler
Örnekler
Aşağıdaki örnekte DragLeave bir öğesi için olay işleyicisi gösterilmektedir Ellipse .The following example shows the DragLeave event handler for an Ellipse element. Bu kod, DragEnter kayıt, elips 'e kaydedilmiş şekilde uygulanarak olay işleyicisinde gerçekleştirilen önizlemeyi geri alır Brush .This code undoes the preview performed in the DragEnter event handler by applying the saved Brush to the ellipse.
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
Açıklamalar
Bu olay, bir nesne, bırakılmadan bırakma hedefi olarak davranan bir öğe sınırlarının dışına sürüklendiğinde bir kez tetiklenir.This event is raised once each time an object is dragged out of the bounds of an element that is acting as a drop target without being dropped. Öğenin özelliği ise bu olay oluşturulmaz AllowDrop false
.This event is not raised if the element's AllowDrop property is false
.
Olay işleyicisinde yaptığınız tüm değişiklikleri geri almak için genellikle bu olayı işleyebilirsiniz DragEnter .You typically handle this event to undo any changes that you made in the DragEnter event handler.
Yönlendirilmiş Olay BilgisiRouted Event Information
Tanımlayıcı alanıIdentifier field | DragLeaveEvent |
Yönlendirme stratejisiRouting strategy | TırmanmaBubbling |
TemsilciDelegate | DragEventHandler |
Karşılık gelen Tünel olayı PreviewDragLeave .The corresponding tunneling event is PreviewDragLeave.