Esempio n. 1
0
        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;
            }
        }
Esempio n. 2
0
        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;
            }
        }
Esempio n. 3
0
 private void DeleteTaskButton_Click(object sender, EventArgs e)
 {
     TaskDeleted?.Invoke(this.Tag, EventArgs.Empty);
 }