private void SetCellContext(UICollectionView collectionView, UICollectionViewCell cell, NSIndexPath indexPath, object item) { _ignoreSelectedItems = true; BindingServiceProvider.ContextManager.GetBindingContext(cell).Value = item; _ignoreSelectedItems = false; if (collectionView.AllowsMultipleSelection) { if (cell.Selected) { collectionView.SelectItem(indexPath, UseAnimations, UICollectionViewScrollPosition.None); ItemSelected(item); } else { collectionView.DeselectItem(indexPath, false); ItemDeselected(item); } } else { cell.Selected = collectionView.AllowsSelection && _selectedItems.Contains(item ?? cell); } }
public void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath) { collectionView.DeselectItem(indexPath, true); var button = CalculatorModel.buttons[indexPath.Row]; model.Input(button); }
public static void DeselectAll(this UICollectionView collectionView, bool animated) { foreach (var item in collectionView.GetIndexPathsForSelectedItems()) { collectionView.DeselectItem(item, animated); } }
public override UICollectionViewCell GetCell(UICollectionView collectionView, Foundation.NSIndexPath indexPath) { TaskCell cell = (TaskCell)collectionView.DequeueReusableCell(TaskCell.CellId, indexPath); cell.ApplyCurrentTheme(); KinderTask task = tasks [indexPath.Row]; cell.TaskName = task.Name; cell.TaskIcon = UIImage.FromBundle(task.IconName); cell.SetCellSize(GetCellSize(collectionView)); cell.Selected = task.IsPending; if (task.IsPending) { collectionView.SelectItem(indexPath, false, UICollectionViewScrollPosition.None); } else { collectionView.DeselectItem(indexPath, false); } if (ShouldAnimateAppearance) { cell.AnimateIconAppearance(); } return(cell); }
public void clearCellSelection() { foreach (NSIndexPath indexPath in CollectionView.GetIndexPathsForSelectedItems()) { CollectionView.DeselectItem(indexPath, false); } }
public void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath) { collectionView.DeselectItem(indexPath, true); var button = buttons[indexPath.Row]; DisplayLabel.Text = button; }
public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath) { collectionView.DeselectItem(indexPath, true); var galleryItem = _galleryItems[indexPath.Row]; var imageViewController = new ImageViewController(galleryItem); _controller.NavigationController.PushViewController(imageViewController, true); }
public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath) { viewModel.Select(indexPath); if (!viewModel.IsSelectionEnabled) { collectionView.DeselectItem(indexPath, false); } }
public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath) { base.ItemSelected(collectionView, indexPath); if (DeselectAutomatically) { collectionView.DeselectItem(indexPath, true); } }
public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath) { var eventInfo = _collectionSource.ItemsSource.Cast <OrgEvent>().ElementAt(indexPath.Row); if (_viewModel.NavigateOrgEventViewCommand.CanExecute(eventInfo)) { _viewModel.NavigateOrgEventViewCommand.Execute(eventInfo); } collectionView.DeselectItem(indexPath, false); }
public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath) { this.navigationController.SetNavigationBarHidden(true, false); CreateNoteViewController createnoteController = this.storyboard.InstantiateViewController("CreateNoteViewController") as CreateNoteViewController; createnoteController.update_new = -100; createnoteController.createdTask = _filteredTasks[indexPath.Row]; this.navigationController.PushViewController(createnoteController, true); collectionView.DeselectItem(indexPath, true); }
protected void ClearSelection(UICollectionView collectionView) { var indexPaths = collectionView.GetIndexPathsForSelectedItems(); if (indexPaths != null) { foreach (NSIndexPath indexPath in indexPaths) { collectionView.DeselectItem(indexPath, UseAnimations); } } SetSelectedItem(collectionView, null, false); }
private void SetSelected(bool value) { _cell.Selected = value; if (value) { _collectionView.SelectItem(_path, false, UICollectionViewScrollPosition.None); } else { _collectionView.DeselectItem(_path, false); } Raise(_cell, EventArgs.Empty); }
public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath) { Speaker s = speakerData[indexPath.Row]; if (bioVC == null) bioVC = new SpeakerBioViewController (s); else bioVC.Update (s); bioVC.Title = s.Name; NavigationController.PushViewController (bioVC, true); collectionView.DeselectItem (indexPath, false); }
protected void ClearSelection() { var indexPaths = _collectionView.GetIndexPathsForSelectedItems(); if (indexPaths != null) { foreach (NSIndexPath indexPath in indexPaths) { _collectionView.DeselectItem(indexPath, UseAnimations); } } _selectedItems.Clear(); SetSelectedItem(null, false); }
private void SetSelected(bool value) { _cell.Selected = value; if (value) { _collectionView.SelectItem(_path, false, UICollectionViewScrollPosition.None); } else { _collectionView.DeselectItem(_path, false); } (_collectionView.Source as CollectionViewSourceBase)?.UpdateSelectedItemInternal(_collectionView, _path, value); Raise(_cell, EventArgs.Empty); }
public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath) { collectionView.DeselectItem(indexPath, true); if (items.Count == 0) { return; } var item = items [indexPath.Row]; if (ItemClick != null) { ItemClick(this, item); } }
public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath) { var data = Source[indexPath.Row]; collectionView.DeselectItem(indexPath, true); // Raise Event EventHandler <SelectedEventArgs> handle = Selected; if (null != handle) { var args = new SelectedEventArgs { Selected = data }; handle(this, args); } }
public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath) { Speaker s = speakerData[indexPath.Row]; if (bioVC == null) { bioVC = new SpeakerBioViewController(s); } else { bioVC.Update(s); } bioVC.Title = s.Name; NavigationController.PushViewController(bioVC, true); collectionView.DeselectItem(indexPath, false); }
public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath) { var data = Source[indexPath.Row]; string JsonFileName = null; JsonFileName = data.Name; collectionView.DeselectItem(indexPath, true); // Raise Event EventHandler <SelectedEventArgs> handle = Selected; if (null != handle) { var args = new SelectedEventArgs { Selected = data.Thumbnail, JsonName = JsonFileName }; handle(this, args); } }
public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath) { var item = _collectionSource.ItemsSource.Cast <object>().ElementAt(indexPath.Row); var contact = item as Contact; if (contact != null) { if (contact.Type == ContactType.Phone) { if (CallPhoneCommand != null && CallPhoneCommand.CanExecute(contact)) { CallPhoneCommand.Execute(contact); } } if (contact.Type == ContactType.Email) { if (ComposeEmailCommand != null && ComposeEmailCommand.CanExecute(contact)) { ComposeEmailCommand.Execute(contact); } } if (contact.Type == ContactType.Url) { var context = new ModalViewContext( ModalViewKind.Browser, contact.ContactText); if (ShowHideModalViewCommand != null && ShowHideModalViewCommand.CanExecute(context)) { ShowHideModalViewCommand.Execute(context); } } } collectionView.DeselectItem(indexPath, false); }
public override UICollectionViewCell GetCell (UICollectionView collectionView, Foundation.NSIndexPath indexPath) { TaskCell cell = (TaskCell)collectionView.DequeueReusableCell (TaskCell.CellId, indexPath); cell.ApplyCurrentTheme (); KinderTask task = tasks [indexPath.Row]; cell.TaskName = task.Name; cell.TaskIcon = UIImage.FromBundle (task.IconName); cell.SetCellSize (GetCellSize (collectionView)); cell.Selected = task.IsPending; if (task.IsPending) collectionView.SelectItem (indexPath, false, UICollectionViewScrollPosition.None); else collectionView.DeselectItem (indexPath, false); if (ShouldAnimateAppearance) cell.AnimateIconAppearance (); return cell; }
public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath) { var cell = collectionView.CellForItem(indexPath) as ContentCellContainer; if (cell == null) { return; } var formsCell = cell.ContentCell; if (CollectionView.ItemTapCommand != null && CollectionView.ItemTapCommand.CanExecute(formsCell.BindingContext)) { CollectionView.ItemTapCommand.Execute(formsCell.BindingContext); } var realIndexPath = GetRealIndexPath(indexPath); CollectionView.NotifyRowTapped(realIndexPath.Section, realIndexPath.Row, formsCell); collectionView.DeselectItem(indexPath, false); }
protected void ClearSelection(UICollectionView collectionView) { var indexPaths = collectionView.GetIndexPathsForSelectedItems(); if (indexPaths != null) { foreach (NSIndexPath indexPath in indexPaths) collectionView.DeselectItem(indexPath, UseAnimations); } SetSelectedItem(collectionView, null, false); }
public void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath) { collectionView.DeselectItem(indexPath, true); }
public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath) { collectionView.DeselectItem(indexPath, true); OnItemTapped.Invoke(this, items[indexPath.Row]); }
public override void ItemSelected(UICollectionView collectionView, Foundation.NSIndexPath indexPath) { collectionView.DeselectItem(indexPath, false); ImageSelected(indexPath.Row); }
[Export("collectionView:didSelectItemAtIndexPath:")] public void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath) { collectionView.DeselectItem(indexPath, true); }