public async void FetchPlayers() { var users = await PlayerDataStore.GetAllAsync(); Players = users.Select(x => new PlayerViewItem(x) { Selected = sessionService.Self == x.RemoteId, SelectedCommand = new Command <string>(SelectPlayer) }).ToList(); var selectedIds = Players.Where(p => p.Selected).Select(x => x.Id); SelectedPlayers = users.Where(x => selectedIds.Any(y => y == x.RemoteId)).ToList(); }
public async void FetchPlayers() { Players = (await PlayerDataStore.GetAllAsync()).ToList(); }