WindowsRuntimeMarshal.AddEventHandler(Func<T,EventRegistrationToken>, Action<EventRegistrationToken>, T) WindowsRuntimeMarshal.AddEventHandler(Func<T,EventRegistrationToken>, Action<EventRegistrationToken>, T) WindowsRuntimeMarshal.AddEventHandler(Func<T,EventRegistrationToken>, Action<EventRegistrationToken>, T) WindowsRuntimeMarshal.AddEventHandler(Func<T,EventRegistrationToken>, Action<EventRegistrationToken>, T) Method

Definition

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);
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

A delegate the represents the event handler that is added.

Exceptions

Security

SecurityCriticalAttribute
requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.

Applies to