ContentElement.PreviewMouseLeftButtonUp 事件
定义
在鼠标指针位于此元素上并且松开鼠标左键时发生。Occurs when the left mouse button is released while the mouse pointer is over this element.
public:
virtual event System::Windows::Input::MouseButtonEventHandler ^ PreviewMouseLeftButtonUp;
public event System.Windows.Input.MouseButtonEventHandler PreviewMouseLeftButtonUp;
member this.PreviewMouseLeftButtonUp : System.Windows.Input.MouseButtonEventHandler
Public Custom Event PreviewMouseLeftButtonUp As MouseButtonEventHandler
事件类型
实现
注解
尽管此 路由事件概述 看起来是通过元素树跟踪隧道路由,但实际上它是一个直接路由事件,每个事件都由元素树逐一引发和 reraised ContentElement 。Although this Routed Events Overview seems to follow a tunneling route through an element tree, it actually is a direct routed event that is raised and reraised along the element tree by each ContentElement.
此事件是多个相关事件之一,用于报告基础事件的鼠标按钮细节 Mouse.PreviewMouseUp ,该事件是由事件路由中的每个元素处理的附加事件。This event is one of several related events that report the mouse-button specifics of an underlying Mouse.PreviewMouseUp event, which is an attached event that is processed by each element along an event route.
此事件的参数公开基础事件的参数 Mouse.PreviewMouseUp 。The arguments of this event expose the arguments of the underlying Mouse.PreviewMouseUp event. 如果该事件在事件路由中标记为 "已处理",则仍会引发鼠标按钮特定的事件;但是,必须通过显式调用来添加鼠标按钮特定事件的处理程序 AddHandler ,并且可以选择处理已标记为已处理的事件,以便作为事件的侦听器。If that event is marked as handled along the event route, the mouse-button specific events are still raised; however, handlers of the mouse-button specific events must be added by explicitly calling AddHandler, with the option to handle events that are already marked as handled, in order to be listeners to the event.
从概念上讲,请将此事件的 (和) 上的其他鼠标按钮事件 ContentElement 为鼠标 "service" (,并使用类) 提供的服务定义 Mouse 。Conceptually, think of this event (and other mouse-button events on ContentElement) to be a mouse "service" (with the service definition provided by the Mouse class). 事件在事件数据中添加了不需要检查鼠标按钮状态 (的原始鼠标事件) 的便利。The event adds the convenience of not needing to check the mouse button states (left-right, up-down) of the original mouse events in the event data. 对于更高级的方案,如检查非标准按钮的状态,可能需要在 Mouse 类而不是上使用 api ContentElement 。For more advanced scenarios, such as checking for states of non-standard buttons, you might need to use the APIs on the Mouse class rather than those on ContentElement.
路由事件信息Routed Event Information
标识符字段Identifier field | PreviewMouseLeftButtonUpEvent |
路由策略Routing strategy | 直接Direct |
委托Delegate | MouseButtonEventHandler |
- 重写 OnPreviewMouseLeftButtonUp 以在派生类中实现此事件的类处理。Override OnPreviewMouseLeftButtonUp to implement class handling for this event in derived classes.