void loadEstimations() { es = EstimationORM.listeEstimations(); myDataObject = new EstimationViewModel(); //LIEN AVEC la VIEW /*listeEstimations.ItemsSource = lp; // bind de la liste avec la source, permettant le binding.*/ }
void loadEstimation() { Estimation = EstimationORM.listeEstimation(); myDataObjectEstimation = new EstimationViewModel(); //LIEN AVEC la VIEW //AdminCombobox.ItemsSource = Admin; // bind de la liste avec la source, permettant le binding.#2#*/ }
private void OnPropertyChanged(string info) { PropertyChangedEventHandler handler = PropertyChanged; if (handler != null) { handler(this, new PropertyChangedEventArgs(info)); this.PropertyChanged(this, new PropertyChangedEventArgs(info)); EstimationORM.updateEstimation(this); } }
private void EstimationButton_Click(object sender, RoutedEventArgs e) { Estimation.Add(myDataObjectEstimation); EstimationORM.insertEstimation(myDataObjectEstimation); myDataObjectEstimation = new EstimationViewModel(); ProduitCombobox.DataContext = myDataObjectEstimation; AdminCombobox.DataContext = myDataObjectEstimation; EstimationTextBox.DataContext = myDataObjectEstimation; dateEstimationcalendar.DataContext = myDataObjectEstimation; }
private void btnAjouter(object sender, RoutedEventArgs e) { es.Add(myDataObject); EstimationORM.insertEstimation(myDataObject); compteur = es.Count(); // Comme on a inséré une Estimation, on crée un nouvel objet EstimationViewModel // Et on réatache tout ce qu'il faut pour que la vue soit propre myDataObject = new EstimationViewModel(); // Comme le contexte des élément de la vue est encore l'ancien EstimationViewModel, // On refait les liens entre age, slider, textbox, bouton et le nouveau EstimationViewModel ComboBoxCommissaire_Priseur.DataContext = myDataObject; ComboBoxVendeur.DataContext = myDataObject; }