I often want to create a uxml template for a container and put arbitrary child elements in it.
In other words, I want to create custom template like ScrollView.
The following is an example.
The following is pseudo-code, so it just shows the concept.
Is it possible to include content on the parent element side like this?
– child template –
<VisualElement>
<Label text="header text"/>
<Slot /> <=== replace by parent (three Label elements will be inserted)
<Label text="footer text"/>
</VisualElement>
– parent template–
<Template src="Container.uxml" name="Container" />
<Instance name="page1" template="Container">
<Label text="awesome contents 1" />
<Label text="awesome contents 2" />
<Label text="awesome contents 3" />
</Instance>