ContentElement.OnMouseLeave(MouseEventArgs) ContentElement.OnMouseLeave(MouseEventArgs) ContentElement.OnMouseLeave(MouseEventArgs) ContentElement.OnMouseLeave(MouseEventArgs) Method

定義

當這個項目上引發未處理的 MouseLeave 附加事件時叫用。Invoked when an unhandled MouseLeave attached event is raised on this element. 實作這個方法可為此事件加入類別處理。Implement this method to add class handling for this event.

protected public:
 virtual void OnMouseLeave(System::Windows::Input::MouseEventArgs ^ e);
protected internal virtual void OnMouseLeave (System.Windows.Input.MouseEventArgs e);
abstract member OnMouseLeave : System.Windows.Input.MouseEventArgs -> unit
override this.OnMouseLeave : System.Windows.Input.MouseEventArgs -> unit
Protected Friend Overridable Sub OnMouseLeave (e As MouseEventArgs)

參數

e
MouseEventArgs MouseEventArgs MouseEventArgs MouseEventArgs

包含事件資料的 MouseEventArgsThe MouseEventArgs that contains the event data.

備註

這個方法沒有任何預設實作。This method has no default implementation. 因為中繼類別繼承中的可能會實作這個方法,我們建議您在實作中呼叫基底實作。Because an intermediate class in the inheritance might implement this method, we recommend that you call the base implementation in your implementation. 您可能會呼叫基底之前或之後您的特殊處理,根據您的需求。You may call base either before or after your special handling, depending on your requirements.

這個方法的目的是類似通用語言執行平台 (CLR)common language runtime (CLR)上的事件模式*方法: 這個方法會提供方法來處理從衍生類別相符的事件所建立的類別處理常式,而不是執行個體處理常式。The purpose of this method is similar to the 通用語言執行平台 (CLR)common language runtime (CLR) event pattern On* methods: this method provides the means to handle the matching event from derived classes by establishing a class handler instead of an instance handler. 在此情況下,符合的事件是路由的事件,提供直接的路由策略。In this case the matching event is a routed event, with a direct routing strategy. 將事件標示為已處理時仍適用於防止一般的執行個體處理常式 (未指定的指handledEventsToo) 叫用。Marking the event as handled is still useful for preventing the typical instance handlers (those that do not specify handledEventsToo) from being invoked.

適用於

另請參閱