private void AddGuest(object guest) { addModel.Clear(); AddSpecialGuest newGuestView = new AddSpecialGuest(addModel); newGuestView.Show(); PropertyChanged(this, new PropertyChangedEventArgs("guestList")); }
private void EditGuest() { if (selectedGuest != null) { LunchClubGuest guest = file.guests.First(m => m.name.Equals(selectedGuest.name)); editModel.name = guest.name; editModel.email = guest.email; editModel.phoneNumber = guest.phoneNumber; editModel.adminName = guest.adminName; editModel.adminEmail = guest.adminEmail; editModel.adminPhoneNumber = guest.adminPhoneNumber; editModel.diet = guest.diet; editModel.editGuest = guest; AddSpecialGuest newGuestView = new AddSpecialGuest(editModel); newGuestView.Show(); PropertyChanged(this, new PropertyChangedEventArgs("guestList")); } else { MessageBox.Show("Please select a guest to edit first."); } }