Пример #1
0
        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);
                }
            }
        }
Пример #2
0
 internal void SearchBoxTextChanged()
 {
     FoundFriends = new ObservableCollection <User>(Client.Friends.Where(f => !SelectedFriends.Contains(f) && f.Nickname.Contains(SearchBox)));
 }