protected virtual GameObject GetOrCreateCellFor(UICollectionView collectionView, IndexPath indexPath, object item) { return (GameObject)collectionView.DequeueReusableCell(DefaultCellIdentifier, indexPath); }
public override void ItemSelected(UICollectionView collectionView, IndexPath indexPath) { var item = GetItemAt(indexPath); var command = SelectionChangedCommand; if (command != null) command.Execute(item); SelectedItem = item; }
protected MvxBaseCollectionViewSource(UICollectionView collectionView) : this(collectionView, UnknownCellIdentifier) { }
protected MvxBaseCollectionViewSource(UICollectionView collectionView, string cellIdentifier) { _collectionView = collectionView; _cellIdentifier = cellIdentifier; }
public override GameObject GetCell(UICollectionView collectionView, IndexPath indexPath) { if ( collectionView == null ) return null; var item = GetItemAt(indexPath); var cell = GetOrCreateCellFor(collectionView, indexPath, item); var bindable = cell.GetComponent(typeof(IMvxDataConsumer)) as IMvxDataConsumer; if (bindable != null) { bindable.DataContext = item; } return cell; }
public override int NumberOfSections(UICollectionView collectionView) { return 1; }
public MvxCollectionViewSource(UICollectionView collectionView) : base(collectionView) { }
public MvxCollectionViewSource(UICollectionView collectionView, string defaultCellIdentifier) : base(collectionView, defaultCellIdentifier) { }
public override int GetItemsCount(UICollectionView collectionView, int section) { if (ItemsSource == null) return 0; return ItemsSource.Count(); }
public virtual int NumberOfSections(UICollectionView collectionView) { return 1; }
public virtual void ItemSelected(UICollectionView collectionView, IndexPath indexPath) { // nothing to do in this base class }
public virtual GameObject GetCell(UICollectionView collectionView, IndexPath indexPath) { return new GameObject(); }
public virtual int GetItemsCount(UICollectionView collectionView, int section) { return 0; }