public async Task AddCoffeeVideoAsync() { try { var dialogData = await _addCoffeeVideoDialogService.ShowDialogAsync(); if (dialogData.DialogResultIsOk) { StartLoading($"Uploading your video {dialogData.BlobName}"); var cloudBlockBlob = await _coffeeVideoStorage.UploadVideoAsync( dialogData.BlobByteArray, dialogData.BlobName, dialogData.BlobTitle, dialogData.BlobDescription); var coffeeVideoViewModel = _coffeeVideoViewModelCreator(cloudBlockBlob); CoffeeVideos.Add(coffeeVideoViewModel); SelectedCoffeeVideo = coffeeVideoViewModel; } } catch (Exception ex) { await _messageDialogService.ShowInfoDialogAsync(ex.Message, "Error"); } finally { StopLoading(); } }
public void RemoveCoffeeVideoViewModel(CoffeeVideoViewModel viewModel) { if (CoffeeVideos.Contains(viewModel)) { CoffeeVideos.Remove(viewModel); if (SelectedCoffeeVideo == viewModel) { SelectedCoffeeVideo = null; } } }
public async Task ReloadAfterSnapshotPromotionAsync(CoffeeVideoViewModel snapshotViewModel) { var coffeeVideoViewModel = CoffeeVideos.SingleOrDefault( viewModel => viewModel.BlobName == snapshotViewModel.BlobName && !viewModel.IsSnapshot); if (coffeeVideoViewModel != null) { await coffeeVideoViewModel.ReloadMetadataAsync(); } }
public void RemoveCoffeeVideoViewModel(CoffeeVideoViewModel viewModel) { if (CoffeeVideos.Contains(viewModel)) { CoffeeVideos.Remove(viewModel); if (SelectedCoffeeVideo == viewModel) { SelectedCoffeeVideo = null; } if (!viewModel.IsSnapshot) { RemoveSnapshotsOfRemovedVideo(viewModel.BlobName); } } }