Exemplo n.º 1
0
        private void displayCarac_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (DataContext != null)
            {
                EntitiesLayer.Caracteristique car = displayCarac.SelectedItem as EntitiesLayer.Caracteristique;

                ViewModel.Stade.StadeViewModel       svm        = DataContext as ViewModel.Stade.StadeViewModel;
                List <EntitiesLayer.Caracteristique> stadeCarac = svm.Caracteristiques;
                stadeCarac.Remove(car);
                svm.Caracteristiques = stadeCarac;
                displayCarac.Items.Refresh();
            }
        }
Exemplo n.º 2
0
        private void caracBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (DataContext != null)
            {
                BusinessLayer.JediTournamentManager jtm = new BusinessLayer.JediTournamentManager();
                string carac = caracBox.SelectedItem as string;

                EntitiesLayer.Caracteristique car = (from x in jtm.getCaracteristiques()
                                                     where x.Nom == carac &&
                                                     x.Type == EntitiesLayer.ETypeCaracteristique.Stade
                                                     select x).FirstOrDefault();

                ViewModel.Stade.StadeViewModel       svm        = DataContext as ViewModel.Stade.StadeViewModel;
                List <EntitiesLayer.Caracteristique> stadeCarac = svm.Caracteristiques;
                stadeCarac.Add(car);
                svm.Caracteristiques = stadeCarac;
                displayCarac.Items.Refresh();
            }
        }