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.
În curând: Pe parcursul anului 2024, vom elimina treptat Probleme legate de GitHub ca mecanism de feedback pentru conținut și îl vom înlocui cu un nou sistem de feedback. Pentru mai multe informații, consultați:Trimiteți și vizualizați feedback pentru