WindowsRuntimeMarshal.AddEventHandler<T> Method
Definition
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.
Adds the specified event handler to a Windows Runtime event.
This API supports the product infrastructure and is not intended to be used directly from your code.
public:
generic <typename T>
static void AddEventHandler(Func<T, System::Runtime::InteropServices::WindowsRuntime::EventRegistrationToken> ^ addMethod, Action<System::Runtime::InteropServices::WindowsRuntime::EventRegistrationToken> ^ removeMethod, T handler);
[System.Security.SecurityCritical]
public static void AddEventHandler<T> (Func<T,System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken> addMethod, Action<System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken> removeMethod, T handler);
public static void AddEventHandler<T> (Func<T,System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken> addMethod, Action<System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken> removeMethod, T handler);
[<System.Security.SecurityCritical>]
static member AddEventHandler : Func<'T, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken> * Action<System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken> * 'T -> unit
static member AddEventHandler : Func<'T, System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken> * Action<System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken> * 'T -> unit
Public Shared Sub AddEventHandler(Of T) (addMethod As Func(Of T, EventRegistrationToken), removeMethod As Action(Of EventRegistrationToken), handler As T)
Type Parameters
- T
The type of the delegate that represents the event handler.
Parameters
- addMethod
- Func<T,EventRegistrationToken>
A delegate that represents the method that adds event handlers to the Windows Runtime event.
- removeMethod
- Action<EventRegistrationToken>
A delegate that represents the method that removes event handlers from the Windows Runtime event.
- handler
- T
A delegate the represents the event handler that is added.
- Attributes
Exceptions
Applies to
Feedback
https://aka.ms/ContentUserFeedback.
Binnenkort: Gedurende 2024 worden GitHub Issues uitgefaseerd als het feedbackmechanisme voor inhoud. Dit wordt vervangen door een nieuw feedbacksysteem. Ga voor meer informatie naar:Feedback verzenden en bekijken voor