Exemple #1
0
        // Se produit quand la sélection du sélecteur de tournoi est modifiée
        private void cbbPalmaresTournament_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            List <Bindings.TournamentPalmares> palmares = new List <Bindings.TournamentPalmares>();

            Tournament selectedTournament = cbbPalmaresTournament.SelectedItem as Tournament;

            if (selectedTournament != null)
            {
                List <Edition> editions = Edition.GetByTournament(selectedTournament.ID);
                foreach (Edition edition in editions)
                {
                    palmares.Add(new Bindings.TournamentPalmares(edition.Year, Match.GetByEdition((uint)edition.ID)));
                }
            }

            lstPalmarestDetails.ItemsSource = palmares.OrderByDescending(_ => _.Year);
        }