public override void ViewDidLoad() { base.ViewDidLoad(); GalleryDataSource.LoadImages(); GalleryCollectionView.RegisterClassForSupplementaryView(typeof(Header), UICollectionElementKindSection.Header, Constants.GalleryHeaderKey); GalleryCollectionView.Source = new GalleryCollectionViewSource(this); var layout = new UICollectionViewFlowLayout { SectionInset = new UIEdgeInsets( Constants.GallerySectionVerticalSpacing, Constants.GallerySectionSize, Constants.GallerySectionSize, Constants.GallerySectionSize), ItemSize = new CGSize(Constants.GalleryTileWidth, Constants.GalleryTileHeight), ScrollDirection = UICollectionViewScrollDirection.Vertical, MinimumLineSpacing = Constants.GalleryLayoutMinLinSpacing, MinimumInteritemSpacing = Constants.GalleryLayoutMinIterItemSpacing, HeaderReferenceSize = new CGSize(GalleryCollectionView.Frame.Size.Width, Constants.GalleryHeaderHeight) }; GalleryCollectionView.SetCollectionViewLayout(layout, true); GenerateNavBarButtons(); GenerateToolBar(); ResetGalleryTitle(); }
public override void ViewWillAppear(bool animated) { GalleryDataSource.LoadImages(); GalleryCollectionView.ReloadData(); }