I have my resource like this
<ContentPage.Resources>
<ResourceDictionary>
<x:String x:Key="LabelAutomationIdentifier">LBL_</x:String>
</ResourceDictionary>
</ContentPage.Resources>
And my listview looks like
<ListView
ItemsSource="{Binding ListItemSource}">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Label
AutomationId="{StaticResource LabelAutomationIdentifier, StringFormat {0}_{Incremental Value OR UniqueIdentifier}'}"
Text="{Binding Title}" />
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
How to add the incremental value in the automation id?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…