Ejemplo n.º 1
0
        public async Task Refresh()
        {
            GameDatas.SuspendCollectionChanged = true;
            var games = Task.Run <IEnumerable <GameData> >(() =>
            {
                return(AllOwnedGames.GetGames(UserData.SteamCommunityId)
                       .Select(o => new GameData(o))
                       .OrderBy(o => o.Installed ? 0 : 1)
                       .ThenBy(o => o.Name)
                       .ToList());
            });

            GameDatas.Clear();

            foreach (var game in (await games))
            {
                GameDatas.Add(game);
                game.SaveToCache();
            }
            GameDatas.SuspendCollectionChanged = false;
            GameDatas.RefreshBinding();
        }