Exemple #1
0
 private void topGamesGridView_ItemClick(object sender, ItemClickEventArgs e)
 {
     if (streamDoneLoading)
     {
         List <object>       parameters = new List <object>();
         GameGridViewBinding gameItem   = ((GameGridViewBinding)e.ClickedItem);
         parameters.Add(gameItem.game);
         Frame.Navigate(typeof(GameStreamsPage), parameters);
     }
 }
        private async void gamesGridView_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (!clickedItem)
            {
                clickedItem = true;
                List <object>       parameters = new List <object>();
                GameGridViewBinding gameItem   = (GameGridViewBinding)e.ClickedItem;
                List <Game>         games      = new List <Game>();
                games = await AppConstants.twixel.RetrieveTopGames(100, false);

                bool foundGame = false;
                foreach (Game game in games)
                {
                    if (game.name == gameItem.game.name)
                    {
                        foundGame = true;
                        parameters.Add(game);
                        Frame.Navigate(typeof(GameStreamsPage), parameters);
                        break;
                    }
                }

                do
                {
                    if (!foundGame)
                    {
                        games = await AppConstants.twixel.RetrieveTopGames(true);

                        foreach (Game game in games)
                        {
                            if (game.name == gameItem.game.name)
                            {
                                foundGame = true;
                                parameters.Add(game);
                                Frame.Navigate(typeof(GameStreamsPage), parameters);
                                break;
                            }
                        }
                    }
                }while (games.Count != 0 && !foundGame);

                Frame.Navigate(typeof(GameStreamsPage), parameters);
            }
        }