コード例 #1
0
        private void AddGuest(object guest)
        {
            addModel.Clear();
            AddSpecialGuest newGuestView = new AddSpecialGuest(addModel);

            newGuestView.Show();
            PropertyChanged(this, new PropertyChangedEventArgs("guestList"));
        }
コード例 #2
0
        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.");
            }
        }