Hello,
Welcome to Microsoft Q&A!
As Viorel-1 said you should not create two different Operation objects and even if you use static class or singleton pattern, it will not triggered as expect also. Because it's out- process model. and it will never generate same instance at same time.
. I get events fired to the main app. I don't understand why does not work with a custom EventHandler declared in the BackgroundTask.
Completed
is even of IBackgroundTaskRegistration
, it is not same as the backgroundtask that inherit IBackgroundTask
, they are two interfaces. and Completed is process-communication, but the custom events is thread-communication.
For your scenario, the better way is use LocalSettings
to pass data or using Progress
property that could trigger Progress event. For more please refer to official code sample
Thank you.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.