public void RegisterClassForSupplementaryView(Type cellType, UICollectionElementKindSection section, NSString reuseIdentifier)
        {
            if (cellType == null)
            {
                throw new ArgumentNullException("cellType");
            }

            RegisterClassForSupplementaryView(Class.GetHandle(cellType), KindToString(section), reuseIdentifier);
        }
Example #2
0
 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");
            }
        }
Example #4
0
        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);
        }
Example #5
0
        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);
 }
Example #10
0
 public void RegisterNibForSupplementaryView(UINib nib, UICollectionElementKindSection section, NSString reuseIdentifier)
 {
     RegisterNibForSupplementaryView (nib, KindToString (section), reuseIdentifier);
 }
Example #11
0
 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;
Example #14
0
 public UICollectionReusableView DequeueReusableSupplementaryView(UICollectionElementKindSection kind, string reuseIdentifier, NSIndexPath indexPath)
 {
     using (var str = (NSString) reuseIdentifier)
         return (UICollectionReusableView) DequeueReusableSupplementaryView (KindToString (kind), str, indexPath);
 }
Example #15
0
 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));
 }
Example #19
0
        public void RegisterClassForSupplementaryView(Type cellType, UICollectionElementKindSection section, NSString reuseIdentifier)
        {
            if (cellType == null)
                throw new ArgumentNullException ("cellType");

            RegisterClassForSupplementaryView (Class.GetHandle (cellType), KindToString (section), reuseIdentifier);
        }
Example #20
0
 public void RegisterClassForSupplementaryView(Type cellType, UICollectionElementKindSection section, string reuseIdentifier)
 {
     using (var str = (NSString) reuseIdentifier)
         RegisterClassForSupplementaryView (cellType, section, str);
 }
Example #21
0
 public NSObject DequeueReusableSupplementaryView(UICollectionElementKindSection section, NSString reuseIdentifier, NSIndexPath indexPath)
 {
     return DequeueReusableSupplementaryView (KindToString (section), reuseIdentifier, indexPath);
 }