I have a listview in Xamarin forms and I am trying to get a checkbox in each row with a command attached to it.
I have tried some things but nothing worked out yet, because I can't get the binded ID with it.
The things that I have already tried are:
- Adding a
CheckedChangedparameter to the checkbox, I can only gettrueorfalse, but not the item this is about.
<CheckBox VerticalOptions="End" x:Name="Checkbox" IsChecked="{Binding IsBought, Mode=TwoWay}" WidthRequest="100" CheckedChanged="Checkbox_CheckedChanged"/>
- Tried with
GestureRecognizerswithCommandParameter, this won't even call the function attached to it. I tried this withTappedandCommand, maybe I need to do the command with Binding?
<CheckBox VerticalOptions="End" x:Name="Checkbox" IsChecked="{Binding IsBought, Mode=TwoWay}" WidthRequest="100" CheckedChanged="Checkbox_CheckedChanged">
<CheckBox.GestureRecognizers>
<TapGestureRecognizer Command="TapGestureRecognizer_Tapped" CommandParameter="{Binding ArtikelID}"/>
</CheckBox.GestureRecognizers>
</CheckBox>
I hope you can help me further :) Have a nice day