protected override void OnBackgroundActivated(BackgroundActivatedEventArgs args) { try { var deferral = args.TaskInstance.GetDeferral(); // Figure out which background task this was switch (args.TaskInstance.Task.Name) { case ToastHelper.TOAST_BACKGROUND_TASK: ToastHelper.HandleBackgroundActivation((ToastNotificationActionTriggerDetail)args.TaskInstance.TriggerDetails); break; } deferral.Complete(); } catch { // Report to your telemetry } }