ListView ItemTapped EventToCommand

Ronald Rex 1,671 Reputation points
2024-01-09T19:58:15.8033333+00:00

 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' 

Developer technologies | .NET | .NET MAUI
Developer technologies | C#
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.