ContentElement.DragOver Event


在輸入系統回報以此項目作為可能置放目標的基礎拖曳事件時發生。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 附加事件的別名,因此當 ContentElement 繼承為基底專案時,ContentElement.DragOver 就會是類別成員清單的一部分。This event creates an alias for the DragDrop.DragOver attached event for this class so that ContentElement.DragOver is part of the class members list when ContentElement 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.

Applies to

See also