private async void OnProcessedReport(IEnumerable <SearchInstance> obj) { await Dispatcher.InvokeAsync(() => { foreach (var instance in obj) { ProcessedInstance.Add(instance); RaiseProgressMessage($"Instance {instance.ImagePath} is done."); } ProcessCount += obj.Count(); }); }
private void OnTaskChanged(SearchTask old_task, SearchTask task) { ProcessedInstance.Clear(); if (old_task != null) { old_task.ProgressReporter = null; old_task.ProcessedReporter = null; } //bind task callback if (task != null) { task.ProgressReporter = OnProgressReport; task.ProcessedReporter = OnProcessedReport; TaskCount = task.SearchImageInstances.Count(); } }