语言

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"/>

事件类型

注解

Important

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

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

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

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

适用于

另请参阅