MaintenanceTrigger class
TOC
Collapse the table of content
Expand the table of content

MaintenanceTrigger class

[ Updated for UWP apps on Windows 10. For Windows 8.x articles, see the archive ]

Represents a maintenance trigger.

Syntax


public ref class MaintenanceTrigger sealed : IBackgroundTrigger

Members

The MaintenanceTrigger class has these types of members:

Constructors

The MaintenanceTrigger class has these constructors.

ConstructorDescription
MaintenanceTrigger Initializes a new instance of a maintenance trigger.

 

Properties

The MaintenanceTrigger class has these properties.

PropertyAccess typeDescription

FreshnessTime

Read-onlyGets the interval of a maintenance trigger.

OneShot

Read-onlyGets whether the maintenance trigger is used only once or each time the FreshnessTime interval elapses.

 

Remarks

Background tasks that use a maintenance trigger run only when the system is connected to AC power.

Note  This class is not agile, which means that you need to consider its threading model and marshaling behavior. For more info, see Threading and Marshaling (C++/CX) and Using Windows Runtime objects in a multithreaded environment (.NET).
 

Examples

The following example shows how to create and register a maintenance trigger.

No code example is currently available or this language may not be supported.

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.ApplicationModel.Background
Windows::ApplicationModel::Background [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

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

Namespace

Windows.ApplicationModel.Background
Windows::ApplicationModel::Background [C++]

Metadata

Windows.winmd

Attributes

[MarshalingBehavior(Standard)]
[Threading(MTA)]
[Version(0x06020000)]

See also

Object
IBackgroundTrigger

 

 

Show:
© 2016 Microsoft