private async void downloadButton_Click(object sender, RibbonControlEventArgs e) { if (SynchronizationContext.Current == null) { SynchronizationContext.SetSynchronizationContext(new WindowsFormsSynchronizationContext()); } ResetStatusDialog(); dialog.Center(); dialog.Show(); if (changedRows.Count > 0) { DialogResult result = MessageBox.Show(dialog, "Je hebt veranderingen gemaakt, wil je die overschrijven?", "Download", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (result != DialogResult.Yes) { return; } } await Download(); dialog.Hide(); changedRows.Clear(); }