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); } }
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; }