Example #1
0
 public async void RegisterBackgroundTask(PortableClasses.Interfaces.IBackgroundTask task)
 {
     if (task is BackgroundTaskModel model)
     {
         using (var service = new BackgroundTaskService())
         {
             await service.RegisterOutOfProcessBackgroundTask(
                 model.Title,
                 model.EntryPoint,
                 model.Trigger as IBackgroundTrigger,
                 //new SystemCondition(SystemConditionType.UserPresent),
                 taskCompleted : model.OnComplete
                 );
         }
     }
 }
Example #2
0
        public void UnregisterBackgroundTask(string taskName)
        {
            var service = new BackgroundTaskService();

            service.UnregisterBackgroundTask(taskName);
        }