Checking we're on the UI thread in WPF

Use the Dispatcher.CheckAccess() method. Note; it doesn't appear in intellisense.
e.g.
if(!Dispatcher.CheckAccess())
{
       // Invoke.
}
else
{
       // Normal code
}

Comments

Popular posts from this blog

Path environmental variable on mac

Setting up node-sass on a mac