Windows.ApplicationModel.Background Namespace

Ermöglicht einer App, Hintergrundaufgaben zu planen, um einen App-Code auszuführen, wenn die App angehalten wird.

Hintergrundaufgaben sind für kleine Arbeitsaufgaben vorgesehen, für die keine Benutzerinteraktion erforderlich ist. Szenarien für Hintergrundaufgaben sind das Herunterladen einer E-Mail, das Anzeigen einer Toastbenachrichtigung für eine eingehende Chatnachricht oder das Reagieren auf eine Änderung des Systemzustands.

Hilfestellung zur Implementierung von Hintergrundaufgaben finden Sie im Abschnitt zum Unterstützen der App mit Hintergrundaufgaben (Windows Store-Apps mit JavaScript und HTML) oder Unterstützen der App mit Hintergrundaufgaben (Windows Store-Apps mit C#/VB/C++ und XAML). Eine allgemeine Übersicht über Hintergrundtasks in Windows Store-Apps bietet das Whitepaper zur Einführung in Hintergrundtasks. Einen Beispielcode, der zeigt, wie Hintergrundtasks zu implementieren sind, finden Sie unter Hintergrundtask-Beispiel.

Member

Windows.ApplicationModel.BackgroundNamespace hat diese Membertypen:

Klassen

Windows.ApplicationModel.BackgroundNamespace hat diese Klassen.

KlasseBeschreibung
AlarmApplicationManager Requests permission from the user to set alarms, and retrieves the status of user permission for the app to set alarms.
BackgroundExecutionManager Provides methods that let an app ask to be added to the lock screen's apps list or query its current access to background activity and badge updates on the lock screen.
BackgroundTaskBuilder Represents a background task to be registered with the system.
BackgroundTaskCompletedEventArgs Represents completion information for a task at the time a completion notification is sent.
BackgroundTaskDeferral Represents a background task deferral returned by the IBackgroundTaskInstance.GetDeferral method.
BackgroundTaskProgressEventArgs Represents progress information for a task at the time a progress update notification is sent.
BackgroundTaskRegistration Represents a background task that has been registered with the system.
BackgroundWorkCost Retrieves a hint about resource availability for background tasks. Background tasks can use this hint to decide how much work to do when they are activated.
DeviceServicingTrigger Represents an event that an application can trigger to initiate a long-running update (firmware or settings) of a device.
DeviceUseTrigger Represents an event that an application can trigger to initiate a fixed-length, long-running operation (content transfer, sync) with a device.
LocationTrigger Represents a location event that triggers a background task. This is used for Geofencing.
MaintenanceTrigger Represents a maintenance trigger.
NetworkOperatorHotspotAuthenticationTrigger Represents a mobile network operator hotspot authentication trigger.
NetworkOperatorNotificationTrigger Represents a mobile network operator notification trigger.
PushNotificationTrigger Represents an object that invokes a background work item on the app in response to the receipt of a raw notification.
SystemCondition Represents a system condition that must be in effect for a background task to run.
SystemTrigger Represents a system event that triggers a background task to run.
TimeTrigger Represents a time event that triggers a background task to run.

 

Delegaten

Windows.ApplicationModel.BackgroundNamespace hat diese Delegaten.

DelegatBeschreibung
BackgroundTaskCanceledEventHandler Represents a method that handles the cancellation of a background task.
BackgroundTaskCompletedEventHandler Represents a method that handles completion events for a background task.
BackgroundTaskProgressEventHandler Represents a method that handles progress update events for a background task.

 

Enumerationen

Windows.ApplicationModel.BackgroundNamespace verfügt über folgende Enumerationen.

EnumerationBeschreibung
AlarmAccessStatus Indicates whether the user has given permission for the app to set alarms.
BackgroundAccessStatus Specifies an app's ability to perform background activity and display a tile on the lock screen.
BackgroundTaskCancellationReason Specifies the reasons for cancelling a background task.
BackgroundTaskThrottleCounter Indicates the type of throttle count to check for in a GetThrottleCount request.
BackgroundWorkCostValue Indicates the current cost of doing background work. Used as a hint to background tasks about how much work they can do.
DeviceTriggerResult Indicates whether the device background task operation was allowed or denied, and if it was denied specifies the reason.
LocationTriggerType Indicates a type of location event for a location background task trigger.
SystemConditionType Specifies a system condition that must be in effect for a background task to run. If a background task with a system condition is triggered, the task will not run until the condition is met.
SystemTriggerType Specifies the system events that can be used to trigger a background task.

 

Schnittstellen

Windows.ApplicationModel.BackgroundNamespace definiert diese Schnittstellen.

SchnittstelleBeschreibung
IBackgroundCondition Used to enforce the system condition object type.
IBackgroundTask Provides a method to perform the work of a background task.
IBackgroundTaskInstance Provides access to a background task instance.
IBackgroundTaskInstance2 Provides access to a background task instance. Inherits from the IBackgroundTaskInstance interface and adds the GetThrottleCount method.
IBackgroundTaskRegistration Provides access to a registered background task.
IBackgroundTrigger Represents the base interface for trigger events.

 

Anforderungen

Mindestens unterstützter Client

Windows 8

Mindestens unterstützter Server

Windows Server 2012

Namespace

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

Metadaten

Windows.winmd

Siehe auch

Einführung in Hintergrundaufgaben - Whitepaper
Beispiel-App für Hintergrundtask

 

 

Anzeigen:
© 2014 Microsoft