I am using C# to develop a UWP app for Windows 10 running only on desktop computers, targeting platform version 10.0.14393.0. Due to business requirements, the app lifecycle
I was trying to solve this for days and days but then found this link. Very good explanation and solution to this and most importantly.. easy to understand. You need to put the code in the app.xaml.cs and also edit the package manifest file. You will also need the following directives in the app.xaml.cs
using Windows.ApplicationModel.ExtendedExecution.Foreground; using System.Threading.Tasks;
non-suspending-uwp