Tutorial by Examples

/// <summary> /// Registers a background task in the system waiting to trigger /// </summary> /// <param name="taskName">Name of the task. Has to be unique</param> /// <param name="taskEntryPoint">Entry point (Namespace) of the class (has to impl...
/// <summary> /// Gets a BackgroundTask by its name /// </summary> /// <param name="taskName">Name of the task to find</param> /// <returns>The found Task or null if none found</returns> public BackgroundTaskRegistration TaskByName(string taskName) ...
public sealed class BackgroundTask : IBackgroundTask { private BackgroundTaskDeferral _deferral; /// <summary> /// Registers the listener to check if the button is pressed /// </summary> /// <param name="taskInstance">An interface to an instan...
private bool IsTaskRegistered(string taskName) => BackgroundTaskRegistration.AllTasks.Any(x => x.Value.Name.Equals(taskName));
var trigger = new ApplicationTrigger(); TaskHandlerMentionedInThisTutorial.RegisterTask(TaskName, entryPoint, trigger, null, true); await trigger.RequestAsync();
/// <summary> /// Unregister a single background task with given name /// </summary> /// <param name="taskName">task name</param> /// <param name="cancelTask">true if task should be cancelled, false if allowed to finish</param> public void...
The background task are a great way to perform some work while your application is not running. Before being able to use then , you will have to register them. Here is a sample of a background task class including the registration with a trigger and a condition and the Run implementation public se...

Page 1 of 1