public override float GetHeightForRow(MonoTouch.UIKit.UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { if (_usedForHeight == null) { _usedForHeight = (RepositoryCellView)tableView.DequeueReusableCell(RepositoryCellView.Key); } var item = ItemAt(indexPath) as RepositoryItemViewModel; if (item != null) { _usedForHeight.ViewModel = item; _usedForHeight.SetNeedsUpdateConstraints(); _usedForHeight.UpdateConstraintsIfNeeded(); _usedForHeight.Bounds = new System.Drawing.RectangleF(0, 0, tableView.Bounds.Width, tableView.Bounds.Height); _usedForHeight.SetNeedsLayout(); _usedForHeight.LayoutIfNeeded(); return(_usedForHeight.ContentView.SystemLayoutSizeFittingSize(MonoTouch.UIKit.UIView.UILayoutFittingCompressedSize).Height + 1); } return(base.GetHeightForRow(tableView, indexPath)); }
public override UITableViewCell GetCell(UITableView tv) { var cell = tv.DequeueReusableCell(CellKey) as RepositoryCellView ?? RepositoryCellView.Create(); return(cell); }
public override UITableViewCell GetCell(UITableView tv) { var cell = tv.DequeueReusableCell(RepositoryCellView.Key) as RepositoryCellView ?? RepositoryCellView.Create(); cell.Bind(_name, _description, ShowOwner ? _owner : null, _avatar); return(cell); }
public float GetHeight(UITableView tableView, NSIndexPath indexPath) { if (GetRootElement() == null) { return(44f); } var cell = GetRootElement().GetOffscreenCell(RepositoryCellView.Key, () => RepositoryCellView.Create()); cell.Bind(_name, _followers.ToString(), _forks.ToString(), _description, ShowOwner ? _owner : null, _image); cell.SetNeedsUpdateConstraints(); cell.UpdateConstraintsIfNeeded(); cell.Bounds = new RectangleF(0, 0, tableView.Bounds.Width, tableView.Bounds.Height); cell.SetNeedsLayout(); cell.LayoutIfNeeded(); return(cell.ContentView.SystemLayoutSizeFittingSize(UIView.UILayoutFittingCompressedSize).Height + 1); }
public override UITableViewCell GetCell(UITableView tv) { var cell = tv.DequeueReusableCell(RepositoryCellView.Key) as RepositoryCellView ?? RepositoryCellView.Create(); if (_image == null && _imageUri != null) { _image = ImageLoader.DefaultRequestImage(_imageUri, this); } cell.Bind(_name, _followers.ToString(), _forks.ToString(), _description, ShowOwner ? _owner : null, _image); return(cell); }
public RepositoryTableViewSource(UITableView tableView) : base(tableView, UITableView.AutomaticDimension, _estimatedHeight) { _cache = new TableViewCellHeightCache <RepositoryCellView, RepositoryItemViewModel>(_estimatedHeight, () => RepositoryCellView.Create(true)); tableView.RegisterNibForCellReuse(RepositoryCellView.Nib, RepositoryCellView.Key); }