public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, Foundation.NSIndexPath indexPath) { switch (editingStyle) { case UITableViewCellEditingStyle.Delete: TaskDeleted.Invoke(this, new TaskEventArgs(TableItems[indexPath.Row])); TableItems.RemoveAt(indexPath.Row); tableView.DeleteRows(new Foundation.NSIndexPath[] { indexPath }, UITableViewRowAnimation.Fade); break; } }
private async Task DeleteTaskAsync() { IsBusy = true; try { var deletionResult = await _tasksService.DeleteTaskAsync(_taskId); if (!deletionResult.IsSuccess) { ShowToast(deletionResult.GetFullMessage()); return; } TaskDeleted?.Invoke(this, EventArgs.Empty); } finally { IsBusy = false; } }
private void DeleteTaskButton_Click(object sender, EventArgs e) { TaskDeleted?.Invoke(this.Tag, EventArgs.Empty); }