private async void DownloadAudioButtonClick(object sender, RoutedEventArgs e) { if (!canDownload || !Directory.Exists(folderPath) || isCorrectId) { return; } await YoutubeHandler.DownloadAudioAsync(folderPath, Completed, progress); }
private async void UrlBoxChanged(object sender, TextChangedEventArgs e) { canDownload = false; Completed.Text = ""; ProgressBar.Value = 0; if (!(sender is TextBox textBox) || (isCorrectId = !await YoutubeHandler.ParseAsync(textBox.Text))) { return; } ChangePreview(await YoutubeHandler.GetThumbnailUrlAsync()); canDownload = true; }