Exemplo n.º 1
0
 public void StartEditingGuest(object selectedItem)
 {
     if (selectedItem != null)
     {
         var guest = selectedItem as Guest;
         GroupBoxName = string.Format("Editing {0}", guest.FirstName);
         var g = new AddGuestViewModel();
         g.Initialize(new EditGuestCommand(guest), () => { StartAddingGuest(); }, guest, null);
         CurrentGuest = g;
     }
 }
Exemplo n.º 2
0
        public void StartAddingGuest()
        {
            var guest = new Guest();

            GroupBoxName = "New Guest";
            var g = new AddGuestViewModel();

            g.Initialize(new EditGuestCommand(guest), () => { StartAddingGuest(); }, guest, () =>
            {
                Guests.Add(guest);
                StartAddingGuest();
            });
            CurrentGuest = g;
        }