Hi John,
Thank you for contacting syncfusion support.
We have checked the reported query “How to find the child image on SfListView” from our end. We would like to inform you that you can achieve your requirement by using TapGestureRecognizer for Grid to get the child of the listview. Please refer to the following code snippet for your reference.
|
<Grid x:Name="grid" RowSpacing="0">
<Grid.GestureRecognizers>
<TapGestureRecognizer Command="{Binding Path=BindingContext.ItemTappedCommand, Source={x:Reference listView}}" CommandParameter="{Binding ContactImage}}"/>
</Grid.GestureRecognizers>
<Image Source="{Binding ContactImage}"
VerticalOptions="Center"
HorizontalOptions="Center"
HeightRequest="50" WidthRequest="50"/>
</Grid> |
C#
ItemTappedCommand to get the tapped item
|
public Command ItemTappedCommand
{
get { return itemTappedCommand; }
protected set { itemTappedCommand = value; }
} .. public ContactsViewModel()
{
contactsinfo = new ObservableCollection<Contacts>();
itemTappedCommand = new Command(OnItemTapped);
GenerateInfo();
} ….
… private void OnItemTapped(object obj)
{
var itemData = (obj as ImageSource);
} |
We hope this helps. Please let us know if you need any further assistance.
Regards,
SaiGanesh Sakthivel