private void DeleteTodoItem(TodoItem item) { if (_isRefreshingItems) { return; } _isRefreshingItems = true; ((MainActivity)this.Activity).BlockUI(); _cts0 = new CancellationTokenSource(); AppController.DeleteTodoItem(_cts0, item.TodoItemId, () => { _adapter.RemoveItem(item); this.TaskList.ReloadData(); Toast.MakeText(this.Activity.ApplicationContext, "An item has been removed!", ToastLength.Long).Show(); }, (error) => { Toast.MakeText(this.Activity.ApplicationContext, error, ToastLength.Long).Show(); }, () => { _isRefreshingItems = false; ((MainActivity)this.Activity).UnblockUI(); }); }
private void DeleteTodoItem(TodoItem item) { if (_isRefreshingItems) { return; } _isRefreshingItems = true; ((MainViewController)this.MainViewController).BlockUI(); _cts0 = new CancellationTokenSource(); AppController.DeleteTodoItem(_cts0, item.TodoItemId, () => { _source.RemoveItem(item); this.TaskList.ReloadData(); UIToast.MakeText("An item has been removed!", UIToastLength.Long).Show(); }, (error) => { UIToast.MakeText(error, UIToastLength.Long).Show(); }, () => { _isRefreshingItems = false; ((MainViewController)this.MainViewController).UnblockUI(); }); }