private async void PublishButton_Click(object sender, RoutedEventArgs e) { SaveState(); Progress <PackageProgress> progress = new Progress <PackageProgress>(ShowStatus); _cancellationTokenSource = new CancellationTokenSource(); try { var dependencies = ((IEnumerable <DependencyModel>)dataGrid.ItemsSource) .Select(x => new ManifestDependency { Id = x.Id, Version = x.Version }) .ToList(); var publishOptions = new PublishOptions( _filePath, VersionTextBox.Text, ReleaseNotesTextBox.Text, ApiKeyTextBox.Text, dependencies, AlwaysLoadFromInternetCheckBox.IsChecked.GetValueOrDefault(false)); await _nugetPackageManager.Publish(publishOptions, progress, _cancellationTokenSource.Token); } catch (Exception ex) { ShowStatus(new PackageProgress { ProgressResultType = ProgressResultType.Failure, Message = $"publish failed : {ex.Message}", }); } }