public override async Task <bool> StoreValue(string key, bool value)
        {
            // Store true/false also in the local settings
            // On app start up we can check if task should be available and active by reading this value
            var result = await base.StoreValue(key, value);

            // Activate or deactivate the background task
            return(result & await CameraUploadService.SetBackgroundTaskAsync(value));
        }
Example #2
0
 private async void SetBackgroundTask(bool value)
 {
     CameraUploadsTaskIsOn = await CameraUploadService.SetBackgroundTaskAsync(value) ? value :
                             TaskService.IsBackGroundTaskActive(CameraUploadService.TaskEntryPoint, CameraUploadService.TaskName);
 }