Share via


GeofenceMonitor.Geofences Property

Definition

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

public:
 property IVector<Geofence ^> ^ Geofences { IVector<Geofence ^> ^ get(); };
IVector<Geofence> Geofences();
public IList<Geofence> Geofences { get; }
var iVector = geofenceMonitor.geofences;
Public ReadOnly Property Geofences As IList(Of Geofence)

Property Value

A collection of the Geofence objects to monitor.

Windows requirements

App capabilities
location

Remarks

Register a Geofence to be monitored by the system by adding it to this collection.

Geofences are persisted to disk, so they only need to be added to the system once. Attempting to add a Geofence with an Id that is already registered will throw an exception.

Attempting to remove a Geofence from the Geofences property will fail with an exception if the specified Geofence is registered with the system but does not belong to the calling application's collection.

This vector reflects only updates made by the app. To view changes made by the system, as in after a single-use Geofence is triggered and removed, the app can call this property again or safely remove the removed Geofence from a previously returned vector.

Applies to

See also