The following example uses VerifyAccess to determine whether a thread has access to the thread that a Button was created on. The method takes an object as an argument, which is cast to a Button. The VerifyAccess method on the Dispatcher of the Button is called to verify access to the thread.

If the calling thread has access to the Dispatcher, the Button is updated by just accessing the members of the Button.