Skip to content

Instantly share code, notes, and snippets.

@alanmcgovern
Created June 8, 2012 13:27
Show Gist options
  • Save alanmcgovern/2895609 to your computer and use it in GitHub Desktop.
Save alanmcgovern/2895609 to your computer and use it in GitHub Desktop.
void Func ()
{
ThreadPool.QueueUserWorkItem (delegate {
InvokeOnMainThread (() => {
myLabel.Text = "Computation beginning...";
});
Thread.Sleep (10000); // Simulate downloading a large file or calculating lots of stuff
InvokeOnMainThread (() => {
myLabel.Text = "Computation complete!";
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment