var tasks = new List();
foreach (var guid in guids)
{
var task = new Task( ...);
tasks.Add(task);
}
foreach (var task in tasks)
{
task.Star
This is not Task Chaining.
You need to do Task chaining using ContinueWith. Last task would need to update the UI.
Task.Factory.StartNew( () => DoThis())
.ContinueWith((t1) => DoThat())
.ContinueWith((t2) => UpdateUi(),
TaskScheduler.FromCurrentSynchronizationContext());
Note the last line has TaskScheduler.FromCurrentSynchronizationContext() this will ensure task will run in the synchronization context (UI Thread).