GeofenceMonitor.GeofenceStateChanged 事件

定义

GeofenceMonitor 的 Geofences 集合中的一个或多个 Geofence 对象的状态发生更改时引发

// Register
event_token GeofenceStateChanged(TypedEventHandler<GeofenceMonitor, IInspectable const&> const& handler) const;

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

// Revoke with event_revoker
GeofenceMonitor::GeofenceStateChanged_revoker GeofenceStateChanged(auto_revoke_t, TypedEventHandler<GeofenceMonitor, IInspectable const&> const& handler) const;
public event TypedEventHandler<GeofenceMonitor,object> GeofenceStateChanged;
function onGeofenceStateChanged(eventArgs) { /* Your code */ }
geofenceMonitor.addEventListener("geofencestatechanged", onGeofenceStateChanged);
geofenceMonitor.removeEventListener("geofencestatechanged", onGeofenceStateChanged);
- or -
geofenceMonitor.ongeofencestatechanged = onGeofenceStateChanged;
Public Custom Event GeofenceStateChanged As TypedEventHandler(Of GeofenceMonitor, Object) 

事件类型

Windows 要求

应用功能
location

注解

当应用正在运行且应用注册的地理围栏的状态发生更改时,将引发此事件。 如果通过调用 ReadReports 获取的集合中存在未读报表,则应用激活时也会引发此事件。 这允许从暂停状态返回的应用收到队列中存在未读报表的通知,并相应地更新 UI。 这还允许你的应用在后台任务由于 使用 SystemCondition 设置的条件(例如等待 Internet 连接或等待用户出现)而未启动的情况下读取在后台发生的报表。

适用于

另请参阅