private void OnCheckBoxCheckedChanged(object sender, PropertyChangedEventArgs e) { FriendWithCheckBox friendWithCheckBox = sender as FriendWithCheckBox; if (friendWithCheckBox.IsChecked) { if (!SelectedFriends.Contains(friendWithCheckBox.Friend)) { SelectedFriends.Add(friendWithCheckBox.Friend); } } else { if (SelectedFriends.Contains(friendWithCheckBox.Friend)) { SelectedFriends.Remove(friendWithCheckBox.Friend); } } }
internal void SearchBoxTextChanged() { FoundFriends = new ObservableCollection <User>(Client.Friends.Where(f => !SelectedFriends.Contains(f) && f.Nickname.Contains(SearchBox))); }