private async Task UploadContinue(string fileName, Stream stream) { Exception error = null; try { if (stream == null) { await DialogService.ShowMessage("Nothing was picked", "No image"); IsBusy = false; return; } Status = $"Uploading {fileName}"; var info = await _service.SaveFile(Model.Id, fileName, stream); Status = "Refreshing children"; await _service.Refresh(Model); await _service.PopulateChildren(Model); PopulateChildrenCollection(); await DialogService.ShowMessage($"Uploaded file with ID {info.Id}", "Success"); Status = "Done"; } catch (Exception ex) { error = ex; } if (error != null) { await DialogService.ShowError(error, "Problem when uploading", "OK", null); IsBusy = false; Status = string.Empty; return; } IsBusy = false; }
public override async Task OpenItem() { Status = $"Loading {Model.Name}"; // Use caching here if (Model.ContentStream == null) { await _service.Refresh(Model); // Needed to make sure that the DownloadUri is up to date await _service.DownloadContent(Model); } var imageInfo = Model as ImageInfo; if (imageInfo != null) { NavigationService.NavigateTo(ViewModelLocator.ImagePageKey, this); IsBusy = false; Status = string.Empty; return; } await SaveItem(); }