Application.LeavingBackground 事件
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
当应用从后台移动到前台时发生。
public:
virtual event LeavingBackgroundEventHandler ^ LeavingBackground;
// Register
event_token LeavingBackground(LeavingBackgroundEventHandler const& handler) const;
// Revoke with event_token
void LeavingBackground(event_token const* cookie) const;
// Revoke with event_revoker
Application::LeavingBackground_revoker LeavingBackground(auto_revoke_t, LeavingBackgroundEventHandler const& handler) const;
public event LeavingBackgroundEventHandler LeavingBackground;
function onLeavingBackground(eventArgs) { /* Your code */ }
application.addEventListener("leavingbackground", onLeavingBackground);
application.removeEventListener("leavingbackground", onLeavingBackground);
- or -
application.onleavingbackground = onLeavingBackground;
Public Custom Event LeavingBackground As LeavingBackgroundEventHandler
事件类型
Windows 要求
设备系列 |
Windows 10 Anniversary Edition (在 10.0.14393.0 中引入)
|
API contract |
Windows.Foundation.UniversalApiContract (在 v3.0 中引入)
|
注解
LeavingBackground 事件在注册它的同一单元中运行。