# EventCallbackDefinition<TElement>

> An object that can be registered on elements of the specified type to react to any event type.

## Definition

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

```csharp
public readonly struct EventCallbackDefinition<TElement> where TElement : VisualElement
```

## Remarks

The same callback instance can be registered on multiple different elements, resulting in effective memory sharing. If the element instance is needed by the callback code, an optional argument can be used to provide it.

Additional Resources: [EventCallback](/engine/6000.6/script-reference/unityengine/uielements/eventcallback.md), [EventCallbackDefinition](/engine/6000.6/script-reference/unityengine/uielements/eventcallbackdefinition.md), [EventCallbackGroup\<TElement>](/engine/6000.6/script-reference/unityengine/uielements/eventcallbackgroup1.md)

## Methods

| Method                                                                                                      | Description                                                 |
| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
| [As](/engine/6000.6/script-reference/unityengine/uielements/eventcallbackdefinition1/as.md)                 | Converts this callback to a more constrained callback type. |
| [Register](/engine/6000.6/script-reference/unityengine/uielements/eventcallbackdefinition1/register.md)     | Adds this callback's event handler to the given element.    |
| [Unregister](/engine/6000.6/script-reference/unityengine/uielements/eventcallbackdefinition1/unregister.md) | Removes this callback from the given element.               |
