Original UWP task not running

I am new to uwp and I am trying to learn how to do a background task. I tried to follow the instructions that I found on the Internet, but did not seem to work. I am not getting an explicit error, but my background task is not writing to the debug console. Any help would be greatly appreciated.

This is my main haml enter image description here

This is my main class. enter image description here

This is my background task in the Windows Runtime Component Project ("MyBackgroundTask") enter image description here

This is my manifest enter image description here

This is before I press the button enter image description here

This is after I press the button enter image description here

+4
source share
1 answer

ApplicationTrigger BackgroundTask. .

ApplicationTrigger.RequestAsync ApplicationTrigger.RequestAsync( ValueSet), .

, trigger.RequestAsync (, ), :

ApplicationTrigger trigger;
...
private async void btnTrigger_Click(object sender, RoutedEventArgs e)
{
    await trigger.RequestAsync();
}
+5

Source: https://habr.com/ru/post/1650419/


All Articles