CustomSystemEventTrigger Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
- Attributes
- Implements
Device family |
Windows 10, version 1803 (introduced in 10.0.17134.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v6.0)
|
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.
Custom |
Creates an instance of a CustomSystemEventTrigger, with the specified identifier and recurrence. |
Recurrence |
Gets when this custom system event trigger may be activated. |
Trigger |
The trigger identifier that uniquely identifies the background task that needs to be started by this trigger. |
Product | Versions |
---|---|
WinRT | Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100 |