Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 89864

Xamarin Forms ListView Swipe to Delete functionality not working in iOS

$
0
0

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


Viewing all articles
Browse latest Browse all 89864

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>