public async override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath) { var contact = viewModel.ContactsGrouped[indexPath.Section][indexPath.Row]; await viewModel.DeleteContact(contact); tableView.ReloadData(); }
async void ListViewItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e) { MessageDialogs.SendConfirmation("Are you sure you want to delete this contact?", "Confirmation", async(delete) => { if (!delete) { return; } await viewModel.DeleteContact(viewModel.Contacts[e.Position]); Activity.RunOnUiThread(() => { ((BaseAdapter)listView.Adapter).NotifyDataSetChanged(); }); }); }