I have a Windows Phone 7 application that uses the Dispatcher to make sure code gets run on the UI thread, but sometimes I need to know which thread the method was called on.
How can I detect if a method is called from the UI thread or from a background thread? In Silverlight you would use Dispatcher.CheckAccess, but that is not available on Windows Phone 7.
CheckAccess is there, it just doesn’t show in intellisense. Code it and you’ll see it compiles/runs.