UIElement.DragOver 事件


在輸入系統回報以此項目作為可能置放目標的基礎拖曳事件時發生。Occurs when the input system reports an underlying drag event with this element as the potential drop target.

 event System::Windows::DragEventHandler ^ DragOver;
public event System.Windows.DragEventHandler DragOver;
member this.DragOver : System.Windows.DragEventHandler 
Public Custom Event DragOver As DragEventHandler 




即使拖曳源自專案界限,還是會發生這個事件。This event occurs even if the drag originates in the element bounds. 如果從範圍外開始拖曳,然後在內部移動,則也會引發此事件,以及 DragEnter 和相關的預覽事件。If the drag starts outside the bounds and then moves inside, this event is also raised, as well as DragEnter and related preview events.

此事件會為 DragDrop.DragOver 這個類別建立附加事件的別名, UIElement.DragOverUIElement 繼承為基底專案時,它就是類別成員清單的一部分。This event creates an alias for the DragDrop.DragOver attached event for this class so that UIElement.DragOver is part of the class members list when UIElement is inherited as a base element. 附加至事件的事件處理常式 DragOver 會附加至基礎 DragDrop.DragOver 附加事件,並接收相同的事件資料實例。Event handlers that are attached to the DragOver event are attached to the underlying DragDrop.DragOver attached event and receive the same event data instance.

路由事件資訊Routed Event Information

識別碼欄位Identifier field DragOverEvent
路由策略Routing strategy 鼓 泡Bubbling
代理人Delegate DragEventHandler
  • 對應的通道事件為 PreviewDragOverThe corresponding tunneling event is PreviewDragOver.

  • OnDragOver在衍生類別中覆寫以執行這個事件的類別處理。Override OnDragOver to implement class handling for this event in derived classes.