Mouse.MouseEnter 附加事件


当鼠标指针进入元素的边界时发生。Occurs when the mouse pointer enters the boundaries of an element.

see AddMouseEnterHandler, and RemoveMouseEnterHandler
see AddMouseEnterHandler, and RemoveMouseEnterHandler
see AddMouseEnterHandler, and RemoveMouseEnterHandler


这是一个附加事件。This is an attached event. WPFWPF 将附加事件作为路由事件实现。implements attached events as routed events. 附加事件本质上是一种 XAMLXAML 用于引用事件的语言概念,这些事件可在未定义该事件的对象上进行处理,后者 WPFWPF 通过同时启用事件来遍历路由。Attached events are fundamentally a XAMLXAML language concept for referencing events that can be handled on objects that do not define that event, which WPFWPF expands upon by also enabling the event to traverse a route. 附加事件在代码中没有直接处理语法;若要在代码中附加路由事件的处理程序,请使用指定的 Add * 处理程序方法。Attached events do not have a direct handling syntax in code; to attach handlers for a routed event in code, you use a designated Add*Handler method. 有关详细信息,请参阅 附加事件概述For details, see Attached Events Overview.

此事件使用直接事件处理路由策略。This event uses the direct event handling routing strategy. 直接路由事件不沿路由引发 (它们仅在引发它们) 的同一元素中进行处理。Direct routed events are not raised along a route (they are only handled in the same element on which they are raised). 但是,它们会启用路由事件行为的其他方面,如样式中的事件触发器。They do, however, enable other aspects of routed event behaviors, such as event triggers in styles.

尽管此事件用于跟踪鼠标进入元素的时间,但它也报告 IsMouseOver false 此元素上的属性已从更改为 trueAlthough this event is used to track when the mouse enters an element, it is also reporting the IsMouseOver property has changed from false to true on this element.

路由事件信息Routed Event Information

标识符字段Identifier field MouseEnterEvent
路由策略Routing strategy 直接Direct
委托Delegate MouseEventHandler