In the code below, is there a way to access the index of the loop?
<Panel>
<Each Count='2'>
<Text Value="text" Color="Red" />
</Each>
</Panel>
In the code below, is there a way to access the index of the loop?
<Panel>
<Each Count='2'>
<Text Value="text" Color="Red" />
</Each>
</Panel>
Yes, you can use UX expressions (index()
in this case) to achieve what you need:
<App>
<StackPanel>
<Each Count="2">
<Text Value="text {= index()}" Color="Red" />
</Each>
</StackPanel>
</App>