# EventCallbackGroup<TElement>

> An object that can be registered on elements of a specific type to rapidly register multiple event callbacks.

## Definition

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

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

## Remarks

The same callback group can be registered on multiple different elements, resulting in effective memory sharing. Note that individual callbacks that are also part of a registered group should not be unregistered separately from the rest of their group.

Additional Resources: [EventCallbackDefinition\<TElement>](/engine/6000.7/script-reference/unityengine/uielements/eventcallbackdefinition1.md)

## Constructors

| Constructor                                                                                                                                                                                                                                        | Description                                                                                                                                 |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| [EventCallbackGroup\`1(System.ReadOnlySpan\{UnityEngine.UIElements.EventCallbackDefinition\{\`0}})](/engine/6000.7/script-reference/unityengine/uielements/eventcallbackgroup1/ctor.md#eventcallbackgroup\(readonlyspaneventcallbackdefinitiont\)) | Creates a callback group allowing the provided callbacks to be registered and unregistered all at once on any element of a compatible type. |
| [EventCallbackGroup\`1(UnityEngine.UIElements.EventCallbackDefinition\{\`0}\[\])](/engine/6000.7/script-reference/unityengine/uielements/eventcallbackgroup1/ctor.md#eventcallbackgroup\(eventcallbackdefinitiont\))                               | Creates a callback group allowing the provided callbacks to be registered and unregistered all at once on any element of a compatible type. |

## Methods

| Method                                                                                                 | Description                                              |
| ------------------------------------------------------------------------------------------------------ | -------------------------------------------------------- |
| [Register](/engine/6000.7/script-reference/unityengine/uielements/eventcallbackgroup1/register.md)     | Adds all group event handlers to the given element.      |
| [Unregister](/engine/6000.7/script-reference/unityengine/uielements/eventcallbackgroup1/unregister.md) | Removes all group event handlers from the given element. |
