Exemplo n.º 1
0
        public static T DequeueReusableCell <T>(this UICollectionViewExtended collectionView, Type ofClass, NSIndexPath indexPath) where T : UICollectionViewCell
        {
            var cell = collectionView.DequeueReusableCell(ofClass.ToString(), indexPath) as T;

            var editableCell = cell as IEditable;

            editableCell?.SetEditing(collectionView.IsEditing, false);

            return(cell);
        }
Exemplo n.º 2
0
 public static void RegisterCell <TCell>(this UICollectionViewExtended collectionView) => collectionView.RegisterClassForCell(typeof(TCell), typeof(TCell).ToString());
Exemplo n.º 3
0
 public static T GetHeader <T>(this UICollectionViewExtended collection, NSIndexPath atPath) where T : class
 {
     return(collection.GetSupplementaryView(UICollectionElementKindSectionKey.Header, atPath) as T);
 }
Exemplo n.º 4
0
 public static T DequeueReusableHeader <T>(this UICollectionViewExtended collectionView, Type viewClass, NSIndexPath forPath)
     where T : UICollectionReusableView
 {
     return(collectionView.DequeueReusableSupplementaryView(UICollectionElementKindSection.Header, viewClass.ToString(),
                                                            forPath) as T);
 }
Exemplo n.º 5
0
        public static void RegisterHeader <TOfClass>(this UICollectionViewExtended collectionView)
        {
            Type ofClass = typeof(TOfClass);

            collectionView.RegisterClassForSupplementaryView(ofClass, UICollectionElementKindSection.Header, ofClass.ToString());
        }