# RegisterCallback

> Adds an event handler to the instance. If the event handler has already been registered for the same phase (either TrickleDown or BubbleUp) then this method has no effect.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.UIElements](/engine/6000.0/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

## RegisterCallback\<T>(EventCallback\<T>, TrickleDown)

Adds an event handler to the instance. If the event handler has already been registered for the same phase (either TrickleDown or BubbleUp) then this method has no effect.

```csharp
public void RegisterCallback<TEventType>(EventCallback<TEventType> callback, TrickleDown useTrickleDown = TrickleDown.NoTrickleDown) where TEventType : EventBase<TEventType>, new()
```

### Parameters

**** (\[EventCallback\<T>]\(/engine/6000.0/script-reference/unityengine/uielements/eventcallback1)): The event handler to add.**** (\[TrickleDown]\(/engine/6000.0/script-reference/unityengine/uielements/trickledown)): By default, this callback is called during the BubbleUp phase. Pass `TrickleDown.TrickleDown` to call this callback during the TrickleDown phase.

## RegisterCallback\<T, U>(EventCallback\<T, T>, T, TrickleDown)

Adds an event handler to the instance. If the event handler has already been registered for the same phase (either TrickleDown or BubbleUp) then this method has no effect.

```csharp
public void RegisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType> callback, TUserArgsType userArgs, TrickleDown useTrickleDown = TrickleDown.NoTrickleDown) where TEventType : EventBase<TEventType>, new()
```

### Parameters

**** (\[EventCallback\<T, T>]\(/engine/6000.0/script-reference/unityengine/uielements/eventcallback1)): The event handler to add.**** (T): Data to pass to the callback.**** (\[TrickleDown]\(/engine/6000.0/script-reference/unityengine/uielements/trickledown)): By default, this callback is called during the BubbleUp phase. Pass `TrickleDown.TrickleDown` to call this callback during the TrickleDown phase.
