Hi,
I have a requirement to implement swipe to delete functionality for a ListView. I tried implementing this functionality by adding Context Options to view cell. It worked fine in Android where giving trouble in iOS. Application is becoming un-responsive when I add context options in iOS. Please find below my code snippet to accomplish this.
var deleteAction = new MenuItem { Text = "Delete", IsDestructive = true }; // red background
deleteAction.SetBinding(MenuItem.CommandParameterProperty, new Binding("."));
deleteAction.Clicked += (sender, e) =>
{
var mi = ((MenuItem)sender);
var detail = (ExpenseDetail)mi.CommandParameter;
Debug.WriteLine("Delete Context Action clicked: " + mi.CommandParameter);
detail.DeleteAction(detail);
};
// add to the ViewCell's ContextActions property
ContextActions.Add(deleteAction);
This is the code written in ViewCell.I'm using Xamarin Forms Version 2.3.1.114. Can someone please help me out of this issue.
Thanks,
Sunil