GeofenceMonitor.Geofences | geofences property

Applies to Windows and Windows Phone

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


var geofences = geofenceMonitor.geofences;

Property value

Type: IVector<Geofence> [JavaScript/C++] | System.Collections.Generic.IList<Geofence> [.NET]

A collection of the Geofence objects to monitor.


Register a geofence to be monitored by the system by adding it to the Geofences collection.

The Id is used to uniquely identify a geofence. The Id value must be unique among all geofences associated with the same application and user. Attempting to add a geofence with an Id that is already registered will throw an exception.

Geofences are persisted to disk, so they only need to be added to the system once.

Attempting to remove a geofence from the Geofences collection of GeofenceMonitor.Current 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.


Minimum supported client

Windows 8.1

Minimum supported server

None supported

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]


Windows::Devices::Geolocation::Geofencing [C++]



See also




© 2014 Microsoft. All rights reserved.