public MainWindow() { InitializeComponent(); DALConnection.OpenConnection(); lp = DepartementORM.listeDepartement(); lp1 = PersonenORM.listePersonne(); lp2 = EtudeORM.listeEtude(); lp3 = AnimauxORM.listeAnimaux(); lp4 = CommuneORM.listeCommune(); lp5 = PlageORM.listePlage(); lp7 = ZoneEtudeORM.listeZoneEtude(); //LIEN AVEC la VIEW listeDepartement.ItemsSource = lp; listeCommune.ItemsSource = lp4; listePlage.ItemsSource = PlageZone; listeEtude.ItemsSource = lp2; // listeDepartement2.ItemsSource = lp; // listeCommune2.ItemsSource = CommuneParDepartement; listePlage2.ItemsSource = lp5; // this.DataContext = lp; // bind de la liste avec la source, permettant le binding mais de façon globale sur toute la fenetre }
private void OnPropertyChanged(string info) { PropertyChangedEventHandler handler = PropertyChanged; if (handler != null) { handler(this, new PropertyChangedEventArgs(info)); AnimauxORM.updateAnimaux(this); } }
private void AjouterAnimaux_Click_1(object sender, EventArgs e) { myDataObject3 = new AnimauxViewModel(); myDataObject3.nomEspeceAnimauxProperty = nomEspeceTextBox.Text; AnimauxViewModel nouveau = new AnimauxViewModel(myDataObject3.nomEspeceAnimauxProperty); lp3.Add(nouveau); AnimauxORM.insertAnimaux(nouveau); lp3 = AnimauxORM.listeAnimaux(); nomEspeceTextBox.Text = string.Empty; }