Dela via


GeofenceMonitor Class

Definition

Contains the information about the monitored Geofence objects.

public ref class GeofenceMonitor sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class GeofenceMonitor final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class GeofenceMonitor
Public NotInheritable Class GeofenceMonitor
Inheritance
Object Platform::Object IInspectable GeofenceMonitor
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)
App capabilities
location

Remarks

Use the static Current property to get the GeofenceMonitor object which contains all of an app’s geofence information.

You will receive an IDS_GEOFENCEMONITOR_OUT_OF_SYNC exception if the Location Framework Service event state is out of synchronization with the GeofenceMonitor. You can attempt to recover by removing all event handlers on the GeofenceMonitor or restarting the application. Once all event handlers have been removed, you may add back any event handlers and retry the operation.

Properties

Current

Gets the GeofenceMonitor object which contains all of an app's Geofence information.

Geofences

Returns a vector of the app's Geofence objects currently registered with the system-wide GeofenceMonitor.

LastKnownGeoposition

Last reading of the device's location.

Status

Indicates the current state of the GeofenceMonitor.

Methods

ReadReports()

Gets a collection of status changes to the Geofence objects in the Geofences collection of the GeofenceMonitor.

Events

GeofenceStateChanged

Raised when the state of one or more Geofence objects in the Geofences collection of the GeofenceMonitor has changed

StatusChanged

Raised when the status of the GeofenceMonitor has changed.

Applies to

See also