Example #1
0
        public async Task Refresh()
        {
            await Task.Run(() => SteamAPI.Refresh());

            var games = SteamAPI.Games.Values
                        .Select(o => new GameData(o.Id)
            {
                IsInstalled = o.IsInstalled, Name = o.Name, SquareDraft = o.Banner.Value
            })
                        .OrderBy(o => o.IsInstalled ? 0 : 1)
                        .ThenBy(o => o.Name)
                        .Select(o => new GameDataViewModel(o, _tileCreator, SteamAPI))
                        .ToList();

            var oldSelection = SelectedGameData?.GameModel?.GameID;

            GameDatas.ReplaceAndResetCollection(games);

            SelectedGameData = GameDatas.Where(o => o.GameModel.GameID == oldSelection).FirstOrDefault();
        }