Im created a grouped list view,
inside the grouped header template added stacklayout with tap gesture recogniser for tap command
<ListView x:Name="Groupedlist" SeparatorVisibility="None" HasUnevenRows="True" " IsGroupingEnabled="True" >
<ListView.GroupHeaderTemplate>
<DataTemplate>
<ViewCell>
<StackLayout >
<StackLayout Orientation="Horizontal" HorizontalOptions="FillAndExpand" Margin="20,0,20,0">
<StackLayout.GestureRecognizers>
<TapGestureRecognizer Command="{Binding some}" CommandParameter="khjhjih"/>
<TapGestureRecognizer Tapped="parentTapped" Command="{Binding Source={x:Reference }}" CommandParameter="{Binding Groupedlist}"/>
</StackLayout.GestureRecognizers>-->
<Label Text="{Binding Type}" HorizontalOptions="StartAndExpand" VerticalOptions="Center"/>
</Label>
<Image Source="{Binding Label}" HeightRequest="24" WidthRequest="15" HorizontalOptions="End"/>
</StackLayout>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.GroupHeaderTemplate>
but when i clicked that stack layout app get crashed.?
in cs
private void parentTapped(object sender, EventArgs e)
{
var selectedIndex = expandedGroups.IndexOf(((parent)((StackLayout)sender).GestureRecognizers));
}
don't know how to get the selected index by tapping the stacklayout.?