コード例 #1
0
        private async Task ReloadDataAsync()
        {
            var items = await repository.AllAsync(MainViewController.CurrentUsername);

            TableView.Source = new TodoItemsSource(items.ToArray(), repository, () => TableView.ReloadData());

            TableView.ReloadData();
        }
コード例 #2
0
        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();
        }
コード例 #3
0
        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;
        }