Hi,
If you are using .net Framework 4.5 then use async-await. It parallel your task across multi core (if you have). It has same implementation as Task. The only big feature introduced in .net 4.5 is async-await. I will tell UI thread (Dispatcher Thread) that this process is long running and don't hang UI thread. execute this line of code in saperate thread (Task).
One of my friend (Solution 2 by Kumar Prateek) has provided you solution. but it is 40% done.
Basic syntax is
private void async btnCopy_click(object sender, EventArg a)
{
busyIndicator.IsBusy = true;
await CopyFile();
busyIndicator.IsBusy=false;
}
private Task CopyFile()
{
return Task.Factory.StartNew(()=>{ });
}