Skip to content

Instantly share code, notes, and snippets.

@ArcticEcho
Created October 16, 2013 12:22
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 ArcticEcho/7006863 to your computer and use it in GitHub Desktop.
Save ArcticEcho/7006863 to your computer and use it in GitHub Desktop.
var leave = false;
while (someCondition && !leave)
{
System.Threading.Thread.Sleep(500);
Application.Current.Dispatcher.Invoke(new Action(() =>
{
if (someOtherCondition)
{
// Do stuff...
}
else
{
if (anotherCondition)
{
leave = true;
}
// Do something else...
}
}));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment