public UICollectionViewCell GetCell(UICollectionView collectionView, NSIndexPath indexPath)
        {
            UICollectionReusableView cell = collectionView.DequeueReusableCell("Cell", indexPath);

            ((IThingCell)cell).SetThing(_collection.ElementAt <IThing>(indexPath.Row));

            return((UICollectionViewCell)cell);
        }
        protected virtual void SetupReusableView(UICollectionReusableView reusableView, NSString elementKind, NSIndexPath indexPath, object mvxViewModel)
        {
            Mvx.Resolve <IMvxLog>().Trace($"SetupReusableView started {elementKind} {indexPath}");

            if (reusableView is IMvxBindable mvxIosView)
            {
                Mvx.Resolve <IMvxLog>().Trace($"SetupReusableView in process {elementKind} {indexPath}");
                mvxIosView.DataContext = mvxViewModel;
            }
            else
            {
                Mvx.Resolve <IMvxLog>().Warn($"SetupReusableView is not IMvxBindable {elementKind} {indexPath}");
            }

            Mvx.Resolve <IMvxLog>().Trace($"SetupReusableView ended {elementKind} {indexPath}");
        }
예제 #3
0
        public override UICollectionReusableView GetViewForSupplementaryElement(UICollectionView collectionView, NSString elementKind, NSIndexPath indexPath)
        {
            return(CoreUtility.ExecuteFunction <UICollectionReusableView>("GetViewForSupplementaryElement", delegate()
            {
                object item = null;
                if (this.Items.Count > 0)
                {
                    item = this.Items[indexPath.Row];
                }
                UICollectionReusableView view = null;

                if (this.CustomSupplementaryCreator != null)
                {
                    view = this.CustomSupplementaryCreator(collectionView, elementKind, item, indexPath);
                }

                return view;
            }));
        }