SynchronizationContext.SetThreadStaticContext Method

.NET Framework (current version)

Sets the current context for thread static data.

Namespace:  System.Threading
Assembly:  mscorlib (in mscorlib.dll)

'Declaration
Public Shared Sub SetThreadStaticContext ( _
	syncContext As SynchronizationContext _
)

Parameters

syncContext
Type: System.Threading.SynchronizationContext

The context that is to be set.

ExceptionCondition
MethodAccessException

The property is security-critical but is accessed from transparent code.

Important noteImportant

Do not use this member in an app that targets Windows Phone OS 7.0 or 7.1. If you do, your code will throw a MethodAccessException. This member is security-critical, which restricts it to internal use only by the .NET Framework for Windows Phone class library.

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8
Show: