Пример #1
0
        private void ShowDownloads(object sender, NewDownloadAvailableArgs e)
        {
            var result = e.DownloadResult;

            result.Description = $"{result.Url} ({result.Id})";
            AvailableDownloads.Add(result);
            StateHasChanged();
        }
Пример #2
0
 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;
 }
Пример #3
0
        private void RemoveDownload(object sender, DownloadRemovedArgs e)
        {
            var download = AvailableDownloads?.FirstOrDefault(d => d.Id == e.DownloadId);

            if (download != null)
            {
                AvailableDownloads.Remove(download);
                StateHasChanged();
            }
        }