EventRegistrationToken Struct
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a reference to a delegate that receives change notifications.
.NET When programming with .NET, this type is hidden. For advanced scenarios, use System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken instead.
C++/WinRT In the C++/WinRT language projection, this type appears as winrt::event_token.
public value class EventRegistrationToken
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.FoundationContract, 65536)]
struct EventRegistrationToken
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.FoundationContract), 65536)]
public struct EventRegistrationToken
var eventRegistrationToken = {
value : /* Your value */
}
Public Structure EventRegistrationToken
- Inheritance
-
EventRegistrationToken
- Attributes
Device family |
Windows 10 (introduced in 10.0.10240.0)
|
API contract |
Windows.Foundation.FoundationContract (introduced in v1.0)
|
When programming with .NET, this type is hidden and developers that need an event registration token for advanced event scenarios should use the System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken type. For most app code, you won't need EventRegistrationToken (or event registration tokens) at all, because the add/remove syntax for C# and Visual Basic languages enables the compiler to generate the registration tokens from a simpler syntax.
In the event subscription model, a delegate registers to receive change notifications from a specified object such as a collection. The EventRegistrationToken is used to remove the delegate as a subscriber of change notifications when notifications are no longer needed.
Value |
The reference to the delegate. A valid reference will not have a value of zero. |
Termék | Verziók |
---|---|
WinRT | Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100 |