Search code examples
wpfuwpdesktop-bridge

Can I do a in-process background task in a WPF app in Desktop Bridge


I've used Desktop Bridge (Project Centennial) to convert my WPF application into the UWP world. In the converted app I'm going to use a background task. It would be very conveniant if I could run it in in-process but as far as I understand it is not possible to do in the WPF process?

Correct? Or is there some magic trick I could use?


Solution

  • You can indeed use an app service that runs in the same process as its host UWP app, but a WPF application has a different Application class than the Windows.UI.Xaml UWP Application class that has no OnBackgroundActivated method to be called when the app service is invoked.

    So you should either use a background task that runs in a separate process or convert your application into a pure UWP app.