Exemple #1
0
        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();
        }
Exemple #2
0
 public async void FetchPlayers()
 {
     Players = (await PlayerDataStore.GetAllAsync()).ToList();
 }