private void handleDeleteTableViewRowAction(UITableViewRowAction _, NSIndexPath indexPath) { SwipeToDeleteWasUsed?.Invoke(this, EventArgs.Empty); var timeEntry = (TimeEntryViewModel)GetItemAt(indexPath); DeleteTimeEntryCommand.Execute(timeEntry); }
private UIContextualAction deleteSwipeActionFor(TimeEntryViewModel timeEntry) { var deleteAction = UIContextualAction.FromContextualActionStyle( UIContextualActionStyle.Destructive, Resources.Delete, (action, sourceView, completionHandler) => { SwipeToDeleteWasUsed?.Invoke(this, EventArgs.Empty); swipeToDeleteSubject.OnNext(timeEntry); completionHandler.Invoke(finished: true); } ); deleteAction.BackgroundColor = Color.TimeEntriesLog.DeleteSwipeActionBackground.ToNativeColor(); return(deleteAction); }