# OnViewAttached()

> Called when the node's INodeView.Root is attached to a UI panel.

## Definition

* **Type:** Method
* **Namespace:** [Unity.GraphToolkit.Editor](/engine/6000.7/script-reference/unity/graphtoolkit/editor.md)
* **Assembly:** UnityEditor

```csharp
public virtual void OnViewAttached()
```

### Remarks

Fires whenever the visual element receives an [AttachToPanelEvent](/engine/6000.7/script-reference/unityengine/uielements/attachtopanelevent.md). This can happen multiple times during a node's lifetime — for example when the user tabs away from and back to the graph view, or when a block node is dragged and re-parented under a different context. Use this callback for logic that needs to respond to panel-attach events, such as subscribing to panel-level events.
