DragDrop.AddPreviewDragLeaveHandler(DependencyObject, DragEventHandler) 方法

定義

PreviewDragLeave 事件處理常式加入指定的相依性物件中。Adds a PreviewDragLeave event handler to a specified dependency object.

public:
 static void AddPreviewDragLeaveHandler(System::Windows::DependencyObject ^ element, System::Windows::DragEventHandler ^ handler);
public static void AddPreviewDragLeaveHandler (System.Windows.DependencyObject element, System.Windows.DragEventHandler handler);
static member AddPreviewDragLeaveHandler : System.Windows.DependencyObject * System.Windows.DragEventHandler -> unit
Public Shared Sub AddPreviewDragLeaveHandler (element As DependencyObject, handler As DragEventHandler)

參數

element
DependencyObject

要在其中加入事件處理常式的相依性物件 (UIElementContentElement)。The dependency object (a UIElement or ContentElement) to which to add the event handler.

handler
DragEventHandler

參考要加入之處理常式方法的委派。A delegate that references the handler method to be added.

備註

當物件拖曳出元素的界限時,就會發生 PreviewDragLeave 事件。The PreviewDragLeave event occurs when an object is dragged out of the element's bounds.

這個方法會加入通道版本的 PreviewDragLeave 事件的處理常式。This method adds a handler for the tunneling version of the PreviewDragLeave event. 若要加入此事件之反升版本的處理常式,請參閱 AddDragLeaveHandlerTo add a handler for the bubbling version of this event, see AddDragLeaveHandler.

適用於

另請參閱