private void OnAddActCommand(object o) { CommandChangedEvent2.GetEvent().Handler += CloseAddActWindows; _addActView = new AddActView(); _addActView.Name = "Ajouter"; _addActView.ShowDialog(); if (_addActView.ActView.Valid == true) { Film.Acteurs.Add(_addActView.ActView.Acteur); NotifyPropertyChanged("Film"); } }
private void OnAddCommand(object o) { string source = Parcourir.ToString(); string fileName = System.IO.Path.GetFileName(Parcourir.ToString()); if (System.IO.Directory.GetParent(Parcourir.LocalPath).ToString() != System.IO.Directory.GetParent(Application.ResourceAssembly.Location).ToString()) { string targetFile = System.IO.Directory.GetParent(Application.ResourceAssembly.Location).ToString(); System.IO.File.Copy(@Parcourir.LocalPath, @targetFile + "/" + fileName, true); } Acteur.Photo = new Uri(@System.IO.Directory.GetParent(Application.ResourceAssembly.Location).ToString() + "/" + fileName); Valid = true; CommandChangedEvent2.GetEvent().OnButtonPressedActionHandler2(EventArgs.Empty); }
private void CloseAddActWindows(object sender, EventArgs e) { _addActView.Close(); CommandChangedEvent2.GetEvent().Handler -= CloseAddActWindows; }
private void OnCancelCommand(object o) { Valid = false; CommandChangedEvent2.GetEvent().OnButtonPressedActionHandler2(EventArgs.Empty); }