public void RegisterClassForSupplementaryView(Type cellType, UICollectionElementKindSection section, NSString reuseIdentifier) { if (cellType == null) { throw new ArgumentNullException("cellType"); } RegisterClassForSupplementaryView(Class.GetHandle(cellType), KindToString(section), reuseIdentifier); }
void RegisterSupplementaryViews(UICollectionElementKindSection kind) { CollectionView.RegisterClassForSupplementaryView(typeof(HorizontalSupplementaryView), kind, HorizontalSupplementaryView.ReuseId); CollectionView.RegisterClassForSupplementaryView(typeof(VerticalSupplementaryView), kind, VerticalSupplementaryView.ReuseId); CollectionView.RegisterClassForSupplementaryView(typeof(HorizontalDefaultSupplementalView), kind, HorizontalDefaultSupplementalView.ReuseId); CollectionView.RegisterClassForSupplementaryView(typeof(VerticalDefaultSupplementalView), kind, VerticalDefaultSupplementalView.ReuseId); }
static NSString KindToString(UICollectionElementKindSection section) { switch (section) { case UICollectionElementKindSection.Header: return(UICollectionElementKindSectionKey.Header); case UICollectionElementKindSection.Footer: return(UICollectionElementKindSectionKey.Footer); default: throw new ArgumentOutOfRangeException("section"); } }
public UICollectionViewLayoutAttributes LayoutAttributesForSupplementaryView(UICollectionElementKindSection section, NSIndexPath indexPath) { NSString kind; switch (section) { case UICollectionElementKindSection.Header: kind = UICollectionElementKindSectionKey.Header; break; case UICollectionElementKindSection.Footer: kind = UICollectionElementKindSectionKey.Footer; break; default: throw new ArgumentOutOfRangeException ("section"); } return LayoutAttributesForSupplementaryView (kind, indexPath); }
public UICollectionViewLayoutAttributes LayoutAttributesForSupplementaryView(UICollectionElementKindSection section, NSIndexPath indexPath) { NSString kind; switch (section) { case UICollectionElementKindSection.Header: kind = UICollectionElementKindSectionKey.Header; break; case UICollectionElementKindSection.Footer: kind = UICollectionElementKindSectionKey.Footer; break; default: throw new ArgumentOutOfRangeException("section"); } return(LayoutAttributesForSupplementaryView(kind, indexPath)); }
public NSObject DequeueReusableSupplementaryView(UICollectionElementKindSection section, NSString reuseIdentifier, NSIndexPath indexPath) { return(DequeueReusableSupplementaryView(KindToString(section), reuseIdentifier, indexPath)); }
public void RegisterNibForSupplementaryView(UINib nib, UICollectionElementKindSection section, string reuseIdentifier) { using (var str = (NSString)reuseIdentifier) RegisterNibForSupplementaryView(nib, section, str); }
public void RegisterNibForSupplementaryView(UINib nib, UICollectionElementKindSection section, NSString reuseIdentifier) { RegisterNibForSupplementaryView(nib, KindToString(section), reuseIdentifier); }
public void RegisterClassForSupplementaryView(Type cellType, UICollectionElementKindSection section, string reuseIdentifier) { using (var str = (NSString)reuseIdentifier) RegisterClassForSupplementaryView(cellType, section, str); }
public void RegisterNibForSupplementaryView(UINib nib, UICollectionElementKindSection section, NSString reuseIdentifier) { RegisterNibForSupplementaryView (nib, KindToString (section), reuseIdentifier); }
static NSString KindToString(UICollectionElementKindSection section) { switch (section) { case UICollectionElementKindSection.Header: return UICollectionElementKindSectionKey.Header; case UICollectionElementKindSection.Footer: return UICollectionElementKindSectionKey.Footer; default: throw new ArgumentOutOfRangeException ("section"); } }
public UICollectionReusableView DequeueReusableSupplementaryView(UICollectionElementKindSection kind, string reuseIdentifier, NSIndexPath indexPath) { using (var str = (NSString)reuseIdentifier) return((UICollectionReusableView)DequeueReusableSupplementaryView(KindToString(kind), str, indexPath)); }
/// <summary> /// Dequeues a reusable UICollectionReusableView subclass using specified UICollectionView, elementKind and NSIndexPath. /// Usually called in the UICollectionViewDataSource (or UICollectionViewController) GetViewForSupplementaryElement override. /// This override assumes that the reuseIdentifier of the UICollectionReusableView subclass is the same as /// the Name of the Type. /// </summary> /// <param name="collectionView">The UICollectionView from which to dequeue the reusable view</param> /// <param name="elementKind">The kind of supplementary view to provide. /// The value of this string is defined by the layout object that supports the supplementary view.</param> /// <param name="reuseIdentifier">The reuseIdentifier of the UICollectionReusableView subclass to return.</param> /// <param name="indexPath">The index path that specifies the location of the new supplementary view.</param> /// <typeparam name="T">The Type of the UICollectionReusableView subclass to dequeue and return.</typeparam> public static T Dequeue <T> (this UICollectionView collectionView, UICollectionElementKindSection elementKind, string reuseIdentifier, NSIndexPath indexPath) where T : UICollectionReusableView => collectionView.DequeueReusableSupplementaryView(elementKind, reuseIdentifier, indexPath) as T;
public UICollectionReusableView DequeueReusableSupplementaryView(UICollectionElementKindSection kind, string reuseIdentifier, NSIndexPath indexPath) { using (var str = (NSString) reuseIdentifier) return (UICollectionReusableView) DequeueReusableSupplementaryView (KindToString (kind), str, indexPath); }
public void RegisterNibForSupplementaryView(UINib nib, UICollectionElementKindSection section, string reuseIdentifier) { using (var str = (NSString) reuseIdentifier) RegisterNibForSupplementaryView (nib, section, str); }
/// <summary> /// Dequeues a reusable UICollectionReusableView subclass using specified UICollectionView, elementKind and NSIndexPath. /// Usually called in the UICollectionViewDataSource (or UICollectionViewController) GetViewForSupplementaryElement override. /// This override assumes that the reuseIdentifier of the UICollectionReusableView subclass is the same as /// the Name of the Type. /// </summary> /// <param name="collectionView">The UICollectionView from which to dequeue the reusable view</param> /// <param name="elementKind">The kind of supplementary view to provide. /// The value of this string is defined by the layout object that supports the supplementary view.</param> /// <param name="indexPath">The index path that specifies the location of the new supplementary view.</param> /// <typeparam name="T">The Type of the UICollectionReusableView subclass to dequeue and return.</typeparam> public static T Dequeue <T> (this UICollectionView collectionView, UICollectionElementKindSection elementKind, NSIndexPath indexPath) where T : UICollectionReusableView => collectionView.DequeueReusableSupplementaryView(elementKind, typeof(T).Name, indexPath) as T;
public static T CreateForSupplementaryView <T> (UICollectionElementKindSection section, NSIndexPath indexPath) where T : UICollectionViewLayoutAttributes { return(CreateForSupplementaryView <T> (GetKindForSection(section), indexPath)); }
public static UICollectionViewLayoutAttributes CreateForSupplementaryView(UICollectionElementKindSection section, NSIndexPath indexPath) { return(CreateForSupplementaryView(GetKindForSection(section), indexPath)); }
public void RegisterClassForSupplementaryView(Type cellType, UICollectionElementKindSection section, NSString reuseIdentifier) { if (cellType == null) throw new ArgumentNullException ("cellType"); RegisterClassForSupplementaryView (Class.GetHandle (cellType), KindToString (section), reuseIdentifier); }
public void RegisterClassForSupplementaryView(Type cellType, UICollectionElementKindSection section, string reuseIdentifier) { using (var str = (NSString) reuseIdentifier) RegisterClassForSupplementaryView (cellType, section, str); }
public NSObject DequeueReusableSupplementaryView(UICollectionElementKindSection section, NSString reuseIdentifier, NSIndexPath indexPath) { return DequeueReusableSupplementaryView (KindToString (section), reuseIdentifier, indexPath); }