Hi,
I was wondering if it is possible to bind a method call or Action to a button element.
Imagine the following:
<UXML xmlns:ui="UnityEngine.UIElements" xmlns:ue="UnityEditor.UIElements">
<ui:VisualElement class="toolbar">
<ui:VisualElement class="toolbar-container">
<Style path="Assets/Editor/Resources/ToolbarStyle.uss" />
<ui:Label class="toolbar-element" text="Number of Blocks" />
<ue:IntegerField class="toolbar-element integer" binding-path="NumberOfBlocks" />
<ui:Button class="toolbar-element" text="Create Tower" binding-path="CreateTower" />
</ui:VisualElement>
</ui:VisualElement>
</UXML>
VisualElement with class ‘toolbar-container’ is bound to a class with a public int NumberOfBlocks and a static void CreateTower.