public TacheViewModel(Models.Tache tache) { _tache = tache; if (_tache.statut == null) { _tache.statut = false; } }
public void SupprimerTache() { Models.Tache tache = TacheSelected; Models.Tache testExist = (from T in _context.Taches where T.id == tache.id select T).FirstOrDefault(); if (testExist != null) { _context.Taches.Remove(tache); _context.SaveChanges(); } _ListeTaches.Remove(tache); NotifyPropertyChanged("Taches"); }
public void ValiderTache(Models.Tache tache) { //Si la tache existe, on supprimer l'ancienne et ajoute la modifiée dans la combobox if (_ListeTaches.Contains(tache) == false) { _ListeTaches.Add(tache); } else { _ListeTaches.Remove(tache); _ListeTaches.Add(tache); } NotifyPropertyChanged("Taches"); _tacheCollectionView.MoveCurrentToLast(); }
//Constructeur pour modifier un lien public Tache(Models.Tache tache) { InitializeComponent(); _tacheController = new ViewModels.TacheViewModel(tache); this.DataContext = _tacheController; }