private void OnUploadCompleted(object sender, UploadFileCompletedEventArgs e) { var uploadablePicture = UploadablePictures.FirstOrDefault(elem => elem.PicturePath == e.UploadedFileName); if (uploadablePicture != null) { uploadablePicture.IsUploaded = true; } }
private void OnUploadStarted(object sender, UploadFileStartedEventArgs e) { if (UploadablePictures == null || UploadablePictures.Count == 0) { return; } var uploadablePicture = UploadablePictures.FirstOrDefault(elem => elem.PicturePath == e.UploadedFileName); if (uploadablePicture != null) { _dropBoxCloudStorageManager.UploadProgressChangedCallback = uploadablePicture.OnUploadProgressChanged; } }
private async void Upload(object parameter) { UploadablePictureViewModel.Cancel = false; foreach (var uploadablePicture in UploadablePictures) { uploadablePicture.UploadProgress = 0; uploadablePicture.IsUploaded = false; } this.IsUploading = true; var uploadedCount = await _dropBoxCloudStorageManager .UploadFilesAsync(UploadablePictures .Where(elem => elem.ReadyForUpload) .Select(p => p.PicturePath).ToArray()); this.IsUploading = false; }