BackgroundTaskCanceledEventHandler BackgroundTaskCanceledEventHandler BackgroundTaskCanceledEventHandler BackgroundTaskCanceledEventHandler BackgroundTaskCanceledEventHandler Delegate

Definition

Represents a method that handles the cancellation of a background task.

public : delegate void BackgroundTaskCanceledEventHandler(IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason)
struct BackgroundTaskCanceledEventHandler : winrt::Windows::Foundation::IUnknown
{
   BackgroundTaskCanceledEventHandler(std::nullptr_t = nullptr) noexcept;
   template <typename L> BackgroundTaskCanceledEventHandler(L lambda);
   template <typename F> BackgroundTaskCanceledEventHandler(F* function);
   template <typename O, typename M> BackgroundTaskCanceledEventHandler(O* object, M method);
   void operator()(winrt::Windows::ApplicationModel::Background::IBackgroundTaskInstance const& sender, winrt::Windows::ApplicationModel::Background::BackgroundTaskCancellationReason const& reason) const;
};
public delegate void BackgroundTaskCanceledEventHandler(IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason)
Public Delegate Sub BackgroundTaskCanceledEventHandler(sender As IBackgroundTaskInstance, reason As BackgroundTaskCancellationReason)
var backgroundTaskCanceledEventHandler = function(sender, reason) {

 /* Your code */

}

Parameters

sender
IBackgroundTaskInstance IBackgroundTaskInstance IBackgroundTaskInstance

The background task instance that was cancelled.

reason
BackgroundTaskCancellationReason BackgroundTaskCancellationReason BackgroundTaskCancellationReason

The reason the background task instance was cancelled.

Attributes

Windows 10 requirements

Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)