# PreDispatch

> Allows subclasses to perform custom logic before the event is dispatched.

## Definition

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

## PreDispatch()

Allows subclasses to perform custom logic before the event is dispatched.

> **Warning:**
>
> **Deprecated.** Override PreDispatch(IPanel panel) instead.

```csharp
protected virtual void PreDispatch()
```

## PreDispatch(IPanel)

Allows subclasses to perform custom logic before the event is dispatched.

```csharp
protected virtual void PreDispatch(IPanel panel)
```

### Parameters

**** (\[IPanel]\(/engine/6000.6/script-reference/unityengine/uielements/ipanel)): The panel where the event will be dispatched.
