private void UpdateDeletingToServer(Project project, int indexOf) { TodoistService todoistService = new TodoistService(); var commandTimeGenerated = DateTime.Now; deleteIconButton.IsEnabled = false; todoistService.RemoveTask(commandTimeGenerated, Task, (data) => { app.items.RemoveAt(indexOf); project.cache_count--; taskDeleted = true; MainTodoistPage.updateProjectList(data.Projects); }, (errorMsg) => { //@TODO: Error dynamic }, () => { deleteIconButton.IsEnabled = true; var currentPage = app.RootFrame.Content as PhoneApplicationPage; if (currentPage == this) NavigationService.GoBack(); }); }