public async Task AddGame()
        {
            if (Game == null)
            {
                return;
            }

            bool success = Game.InCollection ? await CardboardKnight.RemoveGameFromUser(Game) : await CardboardKnight.AddGameToUser(Game);

            if (success)
            {
                await CardboardKnight.StoreGame((Game)Game);
            }
        }
        private async Task Load(bool forced)
        {
            try
            {
                IList <Game> games = new List <Game>();
                if (forced)
                {
                    IsBusy = true;

                    var results = await CardboardKnight.GetTop100().ConfigureAwait(false);

                    foreach (var g in results)
                    {
                        games.Add(await CardboardKnight.StoreGame(g).ConfigureAwait(false));
                    }
                }
                else
                {
                    var r = await CardboardKnight.RetrieveGames();

                    var g = r.FirstOrDefault();

                    //This is a *really* ugly query
                    games = r.Where(g => g.Ranks.Any(rank => rank.Category == Category.All && rank.Position >= 1 && rank.Position <= 100))
                            .OrderBy(g => g.Ranks.FirstOrDefault(rank => rank.Category == Category.All).Position)
                            .ToList();

                    if (games.Count < 100)
                    {
                        await Load(true);

                        return;
                    }
                }
                Top100 = new MvxObservableCollection <Game>(games);
            }
            catch (Exception ex)
            {
                //TODO: some sort of logging
            }
            finally
            {
                IsBusy = false;
            }
        }
        public async Task Load(int id)
        {
            Fetched = true;

            var existing = await CardboardKnight.RetrieveGame(id);

            if (existing != null && !string.IsNullOrEmpty(existing.Description)) //assumption is if the description is added, the game has been completely downloaded via the games page.
            {
                Game = existing;
            }
            else
            {
                var g = await CardboardKnight.FetchGame(id);

                Game = await CardboardKnight.StoreGame((Game)g);
            }

            await SetupVideos();
        }
        private async Task <List <Game> > Load(bool forced)
        {
            List <Game> games = new List <Game>();

            try
            {
                if (forced)
                {
                    var results = await CardboardKnight.GetTop100(category : Category);

                    foreach (var g in results)
                    {
                        games.Add(await CardboardKnight.StoreGame((Game)g));
                    }
                }
                else
                {
                    //  This now has issues with multiple-top - 100 lists, and wouldn't allow for paging.
                    //  For now, just fetch the list every time, no caching.

                    //var r = await CardboardKnight.RetrieveGames();
                    //games = r
                    //        .Where(g => g.Rank >= 1 && g.Rank <= 100)
                    //        .OrderBy(g => g.Rank)
                    //        .ToList();

                    //if (games.Count < 100)
                    //{
                    return(await Load(true));

                    //}
                }
                Games = new ObservableCollection <Game>(games);
            }
            catch (Exception ex)
            {
                //Debug.WriteLine(ex);
            }
            return(games);
        }
        public async Task ForceUpdate()
        {
            var g = await CardboardKnight.FetchGame(Game.Id);

            Game = await CardboardKnight.StoreGame(g);
        }
 private async Task UpdateGame(Game g)
 {
     Game = await CardboardKnight.StoreGame((Game)g);
 }