# Init(VisualElement, IUxmlAttributes, CreationContext)

> Initialize a VisualElement instance with values from the UXML element attributes.

## Definition

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

> **Warning:**
>
> **Deprecated.** UxmlTraits is deprecated and will be removed. Use UxmlElementAttribute instead.

```csharp
public virtual void Init(VisualElement ve, IUxmlAttributes bag, CreationContext cc)
```

### Parameters

**** (\[VisualElement]\(/engine/6000.0/script-reference/unityengine/uielements/visualelement)): The VisualElement to initialize.**** (\[IUxmlAttributes]\(/engine/6000.0/script-reference/unityengine/uielements/iuxmlattributes)): A bag of name-value pairs, one for each attribute of the UXML element.**** (\[CreationContext]\(/engine/6000.0/script-reference/unityengine/uielements/creationcontext)): When the element is created as part of a template instance inserted in another document, this contains information about the insertion point.

### Remarks

Override this function in your traits class to initialize your C# object with values read from the UXML document.
