internal void SelectedItem() { if (SelectedFriend != null) { SelectedFriends.Add(SelectedFriend); SearchBox = ""; SearchBoxTextChanged(); } }
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); } } }
public void OnFriendTapped(object sender, SelectionChangedEventArgs args) { if (!args.CurrentSelection.Any()) { return; } FriendWithCheckBox friendWithCheckBox = args.CurrentSelection[0] as FriendWithCheckBox; CollectionView cv = (CollectionView)sender; cv.SelectedItem = null; if (friendWithCheckBox.IsChecked) { SelectedFriends.Remove(friendWithCheckBox.Friend); friendWithCheckBox.IsChecked = false; } else { SelectedFriends.Add(friendWithCheckBox.Friend); friendWithCheckBox.IsChecked = true; } }