public PlayerRankings(GameFlow gf) { InitializeComponent(); db = gf.Db; Player[] users = db.getUserRanking(); this.gf = gf; int rank = 1; foreach (Player player in users) { PlayerPanel pp = new PlayerPanel(); pp.lblPalyerName.Content = player.Name; pp.lblPlayerLoss.Content = player.Loss; pp.lblPlayerRank.Content = rank++; pp.lblPlayerScore.Content = player.Score; pp.lblPlayerWins.Content = player.Win; pp.imgAvatar.Source = new BitmapImage(new Uri(player.Avatar)); //imgPlayer.Source = new BitmapImage(new Uri(currentPlayer.Avatar)); //ltvRankings.Items.Add(pp); Debug.WriteLine(player.Avatar); lstRanking.Items.Add(pp); } }
public TestRanking(GameFlow gf) { InitializeComponent(); db = gf.Db; Player[] users = db.getUserRanking(); this.gf = gf; foreach (Player player in users) { PlayerPanel pp = new PlayerPanel(); pp.lblPalyerName.Content = player.Name; ltvRankings.Items.Add(pp); } }