UIElement.OnMouseLeave(MouseEventArgs) 方法

定义

当此元素引发未处理的 MouseLeave 附加事件时调用。 实现此方法可为此事件添加类处理。

protected:
 virtual void OnMouseLeave(System::Windows::Input::MouseEventArgs ^ e);
protected 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 Overridable Sub OnMouseLeave (e As MouseEventArgs)

参数

e
MouseEventArgs

包含事件数据的 MouseEventArgs

注解

此方法没有默认实现。 由于继承中的中间类可能实现此方法,因此建议在实现中调用基实现。 可以在特殊处理之前或之后调用 base,具体取决于你的要求。

此方法的用途类似于公共语言运行时 (CLR) 事件模式 On* 方法:此方法提供通过建立类处理程序而不是实例处理程序来处理派生类中的匹配事件的方法。 在这种情况下,匹配事件是具有直接路由策略的路由事件。 将事件标记为已处理仍可用于防止调用未指定 handledEventsToo) 的典型实例处理程序 (。

适用于

另请参阅