private void newreleaseABB_Click(object sender, RoutedEventArgs e) { if (sender == null) { return; } string descriptionStr = descriptionTB.Text; if (!LoginContext.GetLoginContext().Pro) { descriptionStr += noProDescriptionTB.Text; } if (!haveAllArtifactsRequired()) { return; } Release r = null; ShowProgressBar(); Task.Factory.StartNew(() => { r = VSTSService.CreateARelease(releaseDefinition.Id, descriptionStr, releaseArtifactsWithVersionsList); }).ContinueWith(async(Task t) => { await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { HideProgressBar(); if (r != null && !String.IsNullOrWhiteSpace(r.Id)) { Utility.ShowToastMessage("Release created successfully!", r.Name); if (Frame.CanGoBack) { Frame.GoBack(); } } else { Utility.ShowToastMessage("Failed to create release.", "Please retry later..."); } }); }); }