ListView ItemTapped EventToCommand

 I want to use the ItemTapped event of the Syncfusion List View Control  in my ViewModel because I am trying to adhere to the MVVM pattern. Also take note that I am using the .Net Community MVVM Toolkit. 

 This is the signature of the method 

private static async void ItemTapped(object sender, ItemTappedEventArgs e)

{

 var customer = (Customer)e.Item;

 var action= await App.Current.MainPage.DisplayActionSheet("Action", "Cancel", null, "Edit", "Delete");


}

I get the following error message.

Cannot apply [RelayCommand] to methods with a signature that doesn't match any of the existing relay command types. And I am also getting this message that says 

 'ItemTappedEventArgs' is an ambiguous reference between 'Microsoft.Maui.Controls.ItemTappedEventArgs' and 'Syncfusion.Maui.ListView.ItemTappedEventArgs' 



1 Reply

SY Suthi Yuvaraj Syncfusion Team January 10, 2024 03:20 PM UTC

Hi Ron Rex,


We have checked the reported query “ListView ItemTapped EventToCommand”, we have created a sample in ToolKit MVVM pattern, we are unable to reproduce the reported crash at our end, we have attached the tested sample, please have a look on it and let us know if we have missed any customization that you have done in your sample.


If possible , could you please modify the sample to replicate the issue or replication procedure or video to reproduce the issue at our end. Which will be more helpful for us to find the solution as soon as possible.


Regards,

Suthi Yuvaraj.


Attachment: ToolkitMVVM_b1d12263.zip

Loader.
Up arrow icon