Beispiel #1
0
        private void OnEditCommand(object o)
        {
            CommandChangedEvent.GetEvent().Handler += CloseEditWindows;

            _editView      = new EditView(Film);
            _editView.Name = "Editer";
            _editView.ShowDialog();


            if (_editView.FilmView.Valid == true)
            {
                ListFilm.Remove(Film);
                ListFilm.Add(_editView.FilmView.Film);
                ToDisplay = ListFilm;
                NotifyPropertyChanged("ToDisplay");
                System.Windows.Forms.MessageBox.Show("Edition effectuée.");
            }
            else
            {
                System.Windows.Forms.MessageBox.Show("Edition annulée.");
            }
        }
Beispiel #2
0
        private void OnAddCommand(object o)
        {
            CommandChangedEvent.GetEvent().Handler += CloseAddWindows;

            _addView      = new AddView();
            _addView.Name = "Ajouter";
            _addView.ShowDialog();



            if (_addView.FilmViewModel.Valid == true)
            {
                ListFilm.Add(_addView.FilmViewModel.Film);
                ListFilm  = ListSort(ListFilm);
                ToDisplay = ListFilm;
                NotifyPropertyChanged("ToDisplay");
                System.Windows.Forms.MessageBox.Show("Ajout effectué.");
            }
            else
            {
                System.Windows.Forms.MessageBox.Show("Ajout annulé.");
            }
        }