Windows Dev Center

The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

EventRegistrationToken Structure

.NET Framework 4.6 and 4.5

A token that is returned when an event handler is added to a Windows Runtime event. The token is used to remove the event handler from the event at a later time.

Namespace:  System.Runtime.InteropServices.WindowsRuntime
Assemblies:   System.Runtime.InteropServices.WindowsRuntime (in System.Runtime.InteropServices.WindowsRuntime.dll)
  mscorlib (in mscorlib.dll)

public value class EventRegistrationToken

The EventRegistrationToken type exposes the following members.

Public methodEqualsReturns a value that indicates whether the current object is equal to the specified object. (Overrides ValueType::Equals(Object).)
Public methodGetHashCodeReturns the hash code for this instance. (Overrides ValueType::GetHashCode().)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodToStringReturns the fully qualified type name of this instance. (Inherited from ValueType.)

Public operatorStatic memberEqualityIndicates whether two EventRegistrationToken instances are equal.
Public operatorStatic memberInequalityIndicates whether two EventRegistrationToken instances are not equal.

Use the EventRegistrationToken structure only if you use native Windows Runtime techniques to add and remove event handlers for Windows Runtime events. If you use the syntax that is provided by the C# or Visual Basic languages to add and remove event handlers, EventRegistrationToken is an implementation detail handled by the compilers.

.NET Framework

Supported in: 4.6, 4.5

.NET for Windows Phone apps

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

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
© 2015 Microsoft