Last active
October 28, 2018 10:06
-
-
Save andy51002000/25f4e3fd2ca66f4d9d6fece3c9b5f30b to your computer and use it in GitHub Desktop.
Overrid OnBackgroundActivated to communicate with win32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected async override void OnBackgroundActivated(BackgroundActivatedEventArgs args) | |
{ | |
base.OnBackgroundActivated(args); | |
if (args.TaskInstance.TriggerDetails is AppServiceTriggerDetails) | |
{ | |
appServiceDeferral = args.TaskInstance.GetDeferral(); | |
args.TaskInstance.Canceled += OnTaskCanceled; // Associate a cancellation handler with the background task. | |
AppServiceTriggerDetails details = args.TaskInstance.TriggerDetails as AppServiceTriggerDetails; | |
Connection = details.AppServiceConnection; | |
// Send request to win32 | |
await SendRequestToWin32(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment