internal void SelectedItem() { if (SelectedFriend != null) { SelectedFriends.Add(SelectedFriend); SearchBox = ""; SearchBoxTextChanged(); } }
/// <summary> /// Handles the user clicking the "Ask to lunch" button. /// </summary> public async void AskToLunch() { var location = SelectedLocation.Name == "Custom" ? new Location { Name = CustomLocation } : SelectedLocation; var lunch = new Lunch(Name, App.User, SelectedFriends.Concat(new[] { App.User }), location, SelectedDate.Add(SelectedTime).LocalDateTime); await App.Api.PostAsync("Lunch", lunch); ShellViewModel.Current.Navigate(typeof(Lunches)); }
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; } }
internal void CreateGroup() { Group.groups.Add(new Group(SelectedFriends.ToList(), GroupName)); }
internal void SearchBoxTextChanged() { FoundFriends = new ObservableCollection <User>(Client.Friends.Where(f => !SelectedFriends.Contains(f) && f.Nickname.Contains(SearchBox))); }