private void Button_Tap(object sender, System.Windows.Input.GestureEventArgs e) { MemberType member = cardView.CardSearchMemberCollection.Where(x => x.Username == MemberAutocomplete.Text).FirstOrDefault(); MemberType isattached = cardView.CardMemberCollection.Where(x => x.Username == MemberAutocomplete.Text).FirstOrDefault(); CardType card = PhoneApplicationService.Current.State["CurrentCard"] as CardType; if (member != null && isattached == null) { cardView.AddNewUserToCard(card.ID, member.ID); } else if (isattached != null) { MessageBox.Show("Selected member is already attached to this card"); } }