Share via


CustomSystemEventTrigger Class

Definition

This class allows you to specify a custom system trigger so that you can register it and respond when it is triggered by the system.

public ref class CustomSystemEventTrigger sealed : IBackgroundTrigger
/// [Windows.Foundation.Metadata.Activatable(Windows.ApplicationModel.Background.ICustomSystemEventTriggerFactory, 393216, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 393216)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
class CustomSystemEventTrigger final : IBackgroundTrigger
[Windows.Foundation.Metadata.Activatable(typeof(Windows.ApplicationModel.Background.ICustomSystemEventTriggerFactory), 393216, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 393216)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
public sealed class CustomSystemEventTrigger : IBackgroundTrigger
function CustomSystemEventTrigger(triggerId, recurrence)
Public NotInheritable Class CustomSystemEventTrigger
Implements IBackgroundTrigger
Inheritance
Object Platform::Object IInspectable CustomSystemEventTrigger
Attributes
Implements

Windows requirements

Device family
Windows 10, version 1803 (introduced in 10.0.17134.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v6.0)

Remarks

Use this class to define a trigger when the OS doesn't provide a system trigger that you need. Such as when a hardware driver and the UWP app both belong to 3rd party, and the hardware driver needs to raise a custom event that its app handles. For example, an audio card that needs to notify a user when an audio jack is plugged in.

Constructors

CustomSystemEventTrigger(String, CustomSystemEventTriggerRecurrence)

Creates an instance of a CustomSystemEventTrigger, with the specified identifier and recurrence.

Properties

Recurrence

Gets when this custom system event trigger may be activated.

TriggerId

The trigger identifier that uniquely identifies the background task that needs to be started by this trigger.

Applies to