Share via


Geofence Class

Definition

Contains the functionality to define a geofence (a geographical area of interest) to monitor.

public ref class Geofence sealed
/// [Windows.Foundation.Metadata.Activatable(Windows.Devices.Geolocation.Geofencing.IGeofenceFactory, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class Geofence final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Activatable(Windows.Devices.Geolocation.Geofencing.IGeofenceFactory, 65536, "Windows.Foundation.UniversalApiContract")]
class Geofence final
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Devices.Geolocation.Geofencing.IGeofenceFactory), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class Geofence
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Devices.Geolocation.Geofencing.IGeofenceFactory), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class Geofence
function Geofence(id, geoshape, monitoredStates, singleUse, dwellTime, startTime, duration)
Public NotInheritable Class Geofence
Inheritance
Object Platform::Object IInspectable Geofence
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

Constructors

Geofence(String, IGeoshape, MonitoredGeofenceStates, Boolean, TimeSpan, DateTime, TimeSpan)

Initializes a new Geofence object given the id, the shape of the geofence, the states to monitor the geofence for, the singleUse flag, the dwellTime for the geofence, the time to start monitoring the geofence, and the duration of the geofence.

Geofence(String, IGeoshape, MonitoredGeofenceStates, Boolean, TimeSpan)

Initializes a new Geofence object given the id, the shape of the geofence, the states to monitor the geofence for, the singleUse flag, and the dwellTime for the geofence.

Geofence(String, IGeoshape, MonitoredGeofenceStates, Boolean)

Initializes a new Geofence object given the id, the shape of the geofence, the states to monitor the geofence for, and the singleUse flag.

Geofence(String, IGeoshape)

Initializes a new Geofence object given the id and the shape of the geofence.

Properties

Duration

Gets the time window, beginning after the StartTime, during which the Geofence is monitored.

DwellTime

The minimum time that a position has to be inside or outside of the Geofence in order for the notification to be triggered.

Geoshape

The shape of the geofence region.

Id

The id of the Geofence.

MonitoredStates

Indicates the states that the Geofence is being monitored for.

SingleUse

Indicates whether the Geofence should be triggered once or multiple times.

StartTime

The time to start monitoring the Geofence.

Applies to

See also