Posts

Showing posts from May, 2012

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 }