UIElement.PreviewMouseDown UIElement.PreviewMouseDown UIElement.PreviewMouseDown UIElement.PreviewMouseDown Event

定义

在指针位于此元素上并且按下任意鼠标按钮时发生。Occurs when any mouse button is pressed while the pointer is over this element.

public:
 event System::Windows::Input::MouseButtonEventHandler ^ PreviewMouseDown;
public event System.Windows.Input.MouseButtonEventHandler PreviewMouseDown;
member this.PreviewMouseDown : System.Windows.Input.MouseButtonEventHandler 
Public Custom Event PreviewMouseDown As MouseButtonEventHandler 

注解

此事件将为此类创建Mouse.PreviewMouseDown附加事件的别名, 因此当继承PreviewMouseDown为基元素时UIElement , 它是类成员列表的一部分。This event creates an alias for the Mouse.PreviewMouseDown attached event for this class, so that PreviewMouseDown is part of the class members list when UIElement is inherited as a base element. 附加到PreviewMouseDown事件的事件处理程序附加到基础Mouse.PreviewMouseDown附加事件, 并接收相同的事件数据实例。Event handlers that are attached to the PreviewMouseDown event are attached to the underlying Mouse.PreviewMouseDown attached event and receive the same event data instance.

事件通常PreviewMouseLeftButtonDown与或PreviewMouseRightButtonDown一起引发, 这对应于按下这两个标准鼠标按钮之一。 PreviewMouseDownThe PreviewMouseDown event is often raised together with either PreviewMouseLeftButtonDown or PreviewMouseRightButtonDown, which correspond to a press of one of the two standard mouse buttons. PreviewMouseLeftButtonDownPreviewMouseRightButtonDown也是路由事件, 但它们是直接路由事件, Mouse.PreviewMouseDown当事件沿事件路由到达此元素时, 将引发相应的按钮特定的事件。PreviewMouseLeftButtonDown and PreviewMouseRightButtonDown are also routed events, but they are direct routed events, and the appropriate button-specific event is raised when the Mouse.PreviewMouseDown event reaches this element along the event route. 请参阅或PreviewMouseLeftButtonDown PreviewMouseRightButtonDown的 "备注"。See Remarks for PreviewMouseLeftButtonDown or PreviewMouseRightButtonDown.

路由事件信息Routed Event Information

标识符字段Identifier field PreviewMouseDownEvent
路由策略Routing strategy 建立Tunneling
委托Delegate MouseButtonEventHandler

适用于