UIElement.PointerCaptureLost 事件

定义

当此元素以前持有的指针捕获移动到另一个元素或其他位置时发生。

public:
 virtual event PointerEventHandler ^ PointerCaptureLost;
// Register
event_token PointerCaptureLost(PointerEventHandler const& handler) const;

// Revoke with event_token
void PointerCaptureLost(event_token const* cookie) const;

// Revoke with event_revoker
UIElement::PointerCaptureLost_revoker PointerCaptureLost(auto_revoke_t, PointerEventHandler const& handler) const;
public event PointerEventHandler PointerCaptureLost;
function onPointerCaptureLost(eventArgs) { /* Your code */ }
uIElement.addEventListener("pointercapturelost", onPointerCaptureLost);
uIElement.removeEventListener("pointercapturelost", onPointerCaptureLost);
- or -
uIElement.onpointercapturelost = onPointerCaptureLost;
Public Custom Event PointerCaptureLost As PointerEventHandler 
<uiElement PointerCaptureLost="eventhandler"/>

事件类型

注解

重要

PointerCaptureLost 可能会触发而不是 PointerReleased。 不要依赖于 PointerPressedPointerReleased 事件始终成对发生。 若要正常运行,你的应用必须侦听并处理代表 “按下” 操作可能的结论的所有事件,其中包括 PointerCaptureLost。 指针可能会因为用户交互或你以编程方式捕获另一个指针或故意释放当前指针捕获而丢失捕获。

成功捕获指针时,不会触发任何事件。 若要捕获指针,请调用 CapturePointer 方法,这通常在其他指针事件的事件处理程序的上下文中完成。 有关如何捕获指针以及为何要捕获指针的详细信息,请参阅 CapturePointer鼠标交互

PointerCaptureLost 是路由事件。 有关路由事件概念的详细信息,请参阅 事件和路由事件概述

PointerCaptureLost 支持将事件处理程序附加到将调用的路由,即使事件的事件数据标记为“ 已处理”也是如此。 请参阅 AddHandler

适用于

另请参阅