Geofence.Duration Geofence.Duration Geofence.Duration Geofence.Duration Geofence.Duration Property

Definition

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

public : TimeSpan Duration { get; }
TimeSpan Duration();
public TimeSpan Duration { get; }
Public ReadOnly Property Duration As TimeSpan
var timeSpan = geofence.duration;

Property Value

TimeSpan TimeSpan TimeSpan

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

Additional features and requirements

Capabilities
location

Remarks

This property is read-only. Use one of the overloaded Geofence constructors to set the duration value.

When the duration time window expires, the system automatically removes the geofence from the system and stops monitoring it. If you want your app to be notified when a geofence expires, be sure to include the GeofenceState.Removed state when initializing the geofence.

The default value for this property is a TimeSpan with a time interval of 0. A time interval of 0 indicates that the geofence will not expire and will be monitored indefinitely or until the app manually removes the geofence.