public async Task UpdateGameList() { gamesList = await serverWorker.TaskGetGamesList(); Device.BeginInvokeOnMainThread(() => { customListViewRecords = new List <UserPage.ElementsOfViewCell>(); if (gamesList != null && gamesList.Count > 0) { for (int i = 0; i < gamesList.Count; i++) { if (gamesList[i].GameState == GameStateEnum.END) { customListViewRecords.Add(new UserPage.ElementsOfViewCell(gamesList[i])); } } gamesListView.ItemsSource = customListViewRecords; } else { gamesListView.ItemsSource = null; } if (customListViewRecords.Count == 0) { gamesListView.IsVisible = false; gameListViewEmptyMessage.IsVisible = true; } else { gamesListView.IsVisible = true; gameListViewEmptyMessage.IsVisible = false; } }); }
public async Task UpdateGameList() { GamesList = await serverWorker.TaskGetGamesList(); }