Table of Contents

Property SetElement

Namespace
Velvet
Assembly
Velvet.Docs.dll

SetElement

Callback ref setter. Used as V.Button(refCallback: _ref.SetElement). Stores the element into Current; the returned Action is the cleanup that resets Current = null on detach. The same delegate instance is returned for the Ref's lifetime, so a patch that passes it again leaves the installed ref untouched. For T values not derived from VisualElement, element as T is always null, so this is primarily used for Element-node refs.

public Func<VisualElement, Action> SetElement { get; }

Property Value

Func<VisualElement, Action>