コード例 #1
0
ファイル: GameHistoryPage.cs プロジェクト: mike-live/RWGame
        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;
                }
            });
        }
コード例 #2
0
ファイル: GameHistoryModel.cs プロジェクト: mike-live/RWGame
 public async Task UpdateGameList()
 {
     GamesList = await serverWorker.TaskGetGamesList();
 }