private void GroupQuad_OnClick(GroupControl sender) { string[] oct = { "Q1", "Q2", "Q3", "Q4" }; for (int i = 0; i < oct.Length; i++) { if (sender.Text == oct[i]) { nation1.Team = matchesOct[i].TeamA; nation2.Team = matchesOct[i].TeamB; nation3.Team = null; nation4.Team = null; dataGrid.ItemsSource = matchesOct; } } }
private void Group_OnClick(GroupControl sender) { List <Match> matches = matchesPlayOff.Where(match => match.Tag == sender.Text).ToList(); List <Team> team = new List <Team>(); foreach (Match match in matches) { if (team.Find(t => t.Code == match.TeamA.Code) == null) { team.Add(match.TeamA); } if (team.Find(t => t.Code == match.TeamB.Code) == null) { team.Add(match.TeamB); } } nation1.Team = team[0]; nation2.Team = team[1]; nation3.Team = team[2]; nation4.Team = team[3]; dataGrid.ItemsSource = matches; }