Skip to content

Instantly share code, notes, and snippets.

@peteraritchie
Created February 8, 2014 15:18
Show Gist options
  • Save peteraritchie/8885287 to your computer and use it in GitHub Desktop.
Save peteraritchie/8885287 to your computer and use it in GitHub Desktop.
var context = TaskScheduler.FromCurrentSynchronizationContext();
var task = Task.Factory.StartNew(() =>
{
TimeConsumingMethod();
});
task.ContinueWith(_ =>
{
myButton.IsEnabled = true;
},
context);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment