I'm new to Xamarin. I want to setup a ListView in Xamarin plus 2 buttons to check/uncheck every CheckBox inside the ListView to utilize the checked ones afterwards. Could you please tell me how to access these Checkboxes with kind of a foreach loop?
<ListView x:Name="countryListView" HasUnevenRows="true" ItemTapped="Handle_ItemTapped">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<ViewCell.ContextActions>
<MenuItem Text="Bla" CommandParameter="{Binding .}" />
<MenuItem Text="Delete" IsDestructive="true" CommandParameter="{Binding .}" Clicked="deleteCountry" />
</ViewCell.ContextActions>
<StackLayout Orientation="Horizontal" Padding="5">
<controls:CircleImage HeightRequest="30" WidthRequest="30" Aspect="AspectFill" Source="{Binding imageURL}" VerticalOptions="Center" HorizontalOptions="Center" />
<!--<Image Source="{Binding imageURL}" />-->
<StackLayout HorizontalOptions="StartAndExpand">
<Label Text="{Binding name}" />
<Label Text="{Binding capital}" />
</StackLayout>
<CheckBox x:Name="checkbox" IsChecked="false" />
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
Thanks,
Thomas
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…