예제 #1
0
        private void InitializeInvites()
        {
            IEnumerable <PartyInvite> invites = PartyInvite.GetAll(ActiveParty.Id);

            foreach (PartyInvite invite in invites)
            {
                FormattedListBoxItem item = new FormattedListBoxItem(invite.Id, invite.GuestName, true);
                item.SetHeight(35);
                listBoxGuests.Items.Add(item);
            }
        }
예제 #2
0
        private void AddInvite(string inviteName)
        {
            PartyInvite invite = PartyInvite.Add(ActiveParty.Id, inviteName);

            foreach (FormattedListBoxItem existingItem in listBoxGuests.Items)
            {
                existingItem.IsSelected = false;
            }
            FormattedListBoxItem item = new FormattedListBoxItem(invite.Id, inviteName, true);

            item.SetHeight(35);
            listBoxGuests.Items.Add(item);
            listBoxGuests.SelectedItem = item;
            listBoxGuests.ScrollIntoView(item);
            buttonDelete.IsEnabled = true;
        }