ContentElement.MouseLeave Event


滑鼠指標離開此元素的邊界時發生。Occurs when the mouse pointer leaves the bounds of this element.

 virtual event System::Windows::Input::MouseEventHandler ^ MouseLeave;
public event System.Windows.Input.MouseEventHandler MouseLeave;
member this.MouseLeave : System.Windows.Input.MouseEventHandler 
Public Custom Event MouseLeave As MouseEventHandler 



MouseLeave 是使用直接事件處理路由策略的路由事件總覽MouseLeave is a Routed Events Overview that uses the direct event handling routing strategy. 直接路由事件不會沿著路由引發;相反地,它們會在引發它們的相同專案中進行處理。Direct routed events are not raised along a route; instead, they are handled in the same element where they are raised. 不過,它們會啟用路由事件行為的其他層面,例如樣式中的事件觸發程式。However, they do enable other aspects of routed event behavior, such as event triggers in styles.

雖然 MouseLeave 追蹤滑鼠離開專案的時間,但此事件會更常報告 IsMouseOver 屬性值已從 true 變更為此元素上的 falseAlthough MouseLeave tracks when the mouse leaves an element, this event more literally reports that the IsMouseOver property value has changed from true to false on this element.

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

路由事件資訊Routed Event Information

識別碼欄位Identifier field MouseLeaveEvent
路由策略Routing strategy 直接Direct
委派Delegate MouseEventHandler
  • 覆寫 OnMouseLeave,以在衍生類別中為這個事件執行類別處理。Override OnMouseLeave to implement class handling for this event in derived classes.

Applies to