Ejemplo n.º 1
0
        public override UITableViewCell GetCell(Cell item, UITableViewCell reusableCell, UITableView tv)
        {
            cellId = cellId ?? new NSString(item.GetType().FullName);
            var cellCache  = FastCellCache.Instance.GetCellCache(tv);
            var fastCell   = item as FastCell;
            var nativeCell = reusableCell as NativeCell;

            if (reusableCell != null && cellCache.IsCached(nativeCell))
            {
                cellCache.RecycleCell(nativeCell, fastCell);
            }
            else
            {
                var newCell = (FastCell)Activator.CreateInstance(item.GetType());
                newCell.BindingContext = item.BindingContext;
                newCell.Parent         = item.Parent;

                if (!newCell.IsInitialized)
                {
                    newCell.PrepareCell();
                }
                nativeCell = new NativeCell(cellId, newCell);
                cellCache.CacheCell(newCell, nativeCell);
            }
            return(nativeCell);
        }
Ejemplo n.º 2
0
            public void CacheCell(FastCell cell, NativeCell view)
            {
                var cellItemsByCoreCells = GetCellItemsByCoreCells(cell.ReuseIdentifier);

                cellItemsByCoreCells [view] = cell;
                OriginalBindingContextsForReusedItems [cell] = cell.BindingContext;
            }
Ejemplo n.º 3
0
			public void RecycleCell (NativeCell view, FastCell newCell)
			{
				if (CellItemsByCoreCells.ContainsKey (view)) {
					var reusedItem = CellItemsByCoreCells [view];
					if (OriginalBindingContextsForReusedItems.ContainsKey (newCell)) {
						reusedItem.BindingContext = OriginalBindingContextsForReusedItems [newCell];
					} else {
						reusedItem.BindingContext = newCell.BindingContext;
					}
				}
			}
Ejemplo n.º 4
0
 public void RecycleCell(NativeCell view, FastCell newCell)
 {
     if (CellItemsByCoreCells.ContainsKey(view))
     {
         var reusedItem = CellItemsByCoreCells [view];
         if (OriginalBindingContextsForReusedItems.ContainsKey(newCell))
         {
             reusedItem.BindingContext = OriginalBindingContextsForReusedItems [newCell];
         }
         else
         {
             reusedItem.BindingContext = newCell.BindingContext;
         }
     }
 }
Ejemplo n.º 5
0
 public bool IsCached(NativeCell view, string reuseIdentifier)
 {
     var cellItemsByCoreCells = GetCellItemsByCoreCells (reuseIdentifier);
     return cellItemsByCoreCells.ContainsKey (view);
 }
Ejemplo n.º 6
0
 public void CacheCell(FastCell cell, NativeCell view)
 {
     var cellItemsByCoreCells = GetCellItemsByCoreCells (cell.ReuseIdentifier);
     cellItemsByCoreCells [view] = cell;
     OriginalBindingContextsForReusedItems [cell] = cell.BindingContext;
 }
Ejemplo n.º 7
0
            public bool IsCached(NativeCell view, string reuseIdentifier)
            {
                var cellItemsByCoreCells = GetCellItemsByCoreCells(reuseIdentifier);

                return(cellItemsByCoreCells.ContainsKey(view));
            }
Ejemplo n.º 8
0
 public void CacheCell(FastCell cell, NativeCell view)
 {
     CellItemsByCoreCells [view] = cell;
     OriginalBindingContextsForReusedItems [cell] = cell.BindingContext;
 }
Ejemplo n.º 9
0
 public bool IsCached(NativeCell view)
 {
     return(CellItemsByCoreCells.ContainsKey(view));
 }
Ejemplo n.º 10
0
			public void CacheCell (FastCell cell, NativeCell view)
			{
				CellItemsByCoreCells [view] = cell;
				OriginalBindingContextsForReusedItems [cell] = cell.BindingContext;
			}
Ejemplo n.º 11
0
			public bool IsCached (NativeCell view)
			{
				return CellItemsByCoreCells.ContainsKey (view);
			}