I have a ListView with GroupStyle in UWP like in the example here. I have the following HeaderTemplate:
<GroupStyle.HeaderTemplate>
<DataTemplate x:DataType="data:GroupInfoList">
<Grid Tapped="Header_Tapped">
<TextBlock Text="{x:Bind Key}" />
</Grid>
</DataTemplate>
</GroupStyle.HeaderTemplate>
and I can get the selected Key by
private void Header_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
{
var selItem = (sender as Grid).DataContext as GroupInfoList;
var selKey = selItem.Key;
}
Now my problem is that despite knowing the selected Key, I cannot access the Items from it. In Debug, I can see the Count Property and it is equal to the number of elements, that are inside the Group, but I do not know, how to iterate through it.
I would very much like to iterate through all Items, that have the same Key as selKey and set a boolean property called _isVisible for all those items. What is a good/fast/effective way to accomplish this?
GroupInfoListis derived fromList<object>. It contains all theContactwith the sameKey. When you getselItem, you can use following code to iterate through it like iterate through aList.