Skip to content

Instantly share code, notes, and snippets.

@nasal
Created January 6, 2015 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nasal/10f1f67e49c1b7f717c2 to your computer and use it in GitHub Desktop.
Save nasal/10f1f67e49c1b7f717c2 to your computer and use it in GitHub Desktop.
C#: Simple thread
new Thread(delegate()
{
Dispatcher.BeginInvoke(new Action(delegate()
{
// Do something in the "main" thread (the thread calling the new thread).
}));
// Do whatever you want.
Thread.Sleep(3000);
Dispatcher.BeginInvoke(new Action(delegate()
{
// Do something else in the "main" thread.
}));
}).Start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment