示例#1
0
 private async Task RunBackgroundTask(IBackgroundTask task, IDeferral deferral)
 {
     try
     {
         await task.RunAsync();
     }
     catch (Exception ex)
     {
         Debug.WriteLine($"AppModel: Background task \"{task.Id}\" failed: {ex}");
     }
     finally
     {
         deferral.EndDeferral();
     }
 }