# OnViewBuilt()

> Called once, after the node's built-in UI is fully constructed and before its VisualElement is attached to the graph view.

## Definition

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

```csharp
public virtual void OnViewBuilt()
```

### Remarks

This is the recommended entry point for allocating custom UI and adding it to [INodeView.Root](/engine/6000.7/script-reference/unity/graphtoolkit/editor/inodeview/root.md). It fires exactly once per view instance, so any element allocated here can be safely cached in a field.

If the node is culled and later revealed, the contents of [INodeView.Root](/engine/6000.7/script-reference/unity/graphtoolkit/editor/inodeview/root.md) are cleared; re-add your cached elements from [NodeView\<T>.OnCullingChanged](/engine/6000.7/script-reference/unity/graphtoolkit/editor/nodeview1/oncullingchanged.md) (when `cullingEnabled` is `false`). Prefer this pattern over allocating a fresh element each time.

### Examples

```csharp
Label m_Label;

public override void OnViewBuilt()
{
    m_Label = new Label($"Node: {Node.Title}");
    View.Root.Add(m_Label);
}
```
