How to enable 'Swipe To Delete' functionality only for specific ViewCells. I mean,
I have a listview with two sections. First section contains Drafted list of items and Second section contains normal lists of items.
I need to enable 'Swipe To Delete' ONLY FOR DRAFT SECTION in it.
My code:
<ListView.ItemTemplate>
**<ViewCell.ContextActions >
<MenuItem Clicked="OnDelete" CommandParameter="{Binding .}"
Text="Delete" IsDestructive="True"/>
</ViewCell.ContextActions>**
<ViewCell.View>
// some list view cell items
</ViewCell.View>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
public void OnDelete(object sender, EventArgs e)
{
var mi = ((MenuItem)sender);
DisplayAlert("Delete Context Action", mi.CommandParameter + " delete context action", "OK");
}
Please help me guys. Thank you so much in Advance... smile: