Geofence.Duration Property

Definition

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

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

Property Value

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

Windows requirements

App 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.

Applies to