private void Window_Closed(object sender, System.EventArgs e) { // Applique les changements à la BDD JediTournamentManager manager = new JediTournamentManager(); ObservableCollection<JediViewModel> jedis = m_jsvm.Jedis; foreach (JediViewModel jvm in jedis) { // Si < 0 alors ajout en BDD cas inexistant if (jvm.Jedi.ID < 0) { manager.addJedi(jvm.Jedi); } else { manager.modJedi(jvm.Jedi); } } // Désabonnement m_jsvm.RemoveJedi -= M_jsvm_RemoveJedi; }