private void RunCleanStatsWorker() { using (_reduceSetsWorker = new BackgroundWorker()) { _reduceSetsWorker.DoWork += (o, args) => { Messaging.RaiseProgress(null, new ProgressBarEventArgs { EventKindOf = EventKind.ResetProgress, Text = "Cleaning Sets", CurrentValue = _imageStatService.ImageSets.Count }); _controller.CleanImageGroupsUsingAlgorthm(Convert.ToDouble(_formSettingsService.GetFormOptions(this).MinimumSimilarityScore)); }; _reduceSetsWorker.RunWorkerCompleted += (o, args) => { Messaging.Talk("Finished reducing sets..."); FillImageGroupsListBox(_imageStatService.ImageSets.Cast <object>().ToArray()); }; _reduceSetsWorker.RunWorkerAsync(); } }