private void ShowDownloads(object sender, NewDownloadAvailableArgs e) { var result = e.DownloadResult; result.Description = $"{result.Url} ({result.Id})"; AvailableDownloads.Add(result); StateHasChanged(); }
public Video( Func <YoutubeVideo <DownloadItem>, DownloadJob, DownloadItem> downloadJobFactory, string baseurl, Action <Video> removeMe) : base(downloadJobFactory, baseurl) { RemoveFromListCommand = new UiCommand(RemoveItem, () => AvailableDownloads.All(x => x.Job.IsBusy == false)); this.removeMe = removeMe; }
private void RemoveDownload(object sender, DownloadRemovedArgs e) { var download = AvailableDownloads?.FirstOrDefault(d => d.Id == e.DownloadId); if (download != null) { AvailableDownloads.Remove(download); StateHasChanged(); } }