示例#1
0
        private void handleDeleteTableViewRowAction(UITableViewRowAction _, NSIndexPath indexPath)
        {
            SwipeToDeleteWasUsed?.Invoke(this, EventArgs.Empty);
            var timeEntry = (TimeEntryViewModel)GetItemAt(indexPath);

            DeleteTimeEntryCommand.Execute(timeEntry);
        }
示例#2
0
        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);
        }