private async Task ReloadDataAsync() { var items = await repository.AllAsync(MainViewController.CurrentUsername); TableView.Source = new TodoItemsSource(items.ToArray(), repository, () => TableView.ReloadData()); TableView.ReloadData(); }
public override async void RowSelected(UITableView tableView, NSIndexPath indexPath) { var selectedItem = items[indexPath.Row]; selectedItem.Done = true; await repository.UpdateAsync(selectedItem); items = (await repository.AllAsync(MainViewController.CurrentUsername)).ToArray(); postDeleteAction(); }
public async Task LoadAsync() { var adapter = new ArrayAdapter <TodoItem>(this, Android.Resource.Layout.SimpleListItem1, (await repository.AllAsync(LoginActivity.CurrentUsername)).ToList()); var listView = FindViewById <ListView>(Resource.Id.items); listView.Adapter = adapter; }