Beispiel #1
0
        public override UITableViewCell GetCell(UITableView tv)
        {
            var c = tv.DequeueReusableCell(CommitCellView.Key) as CommitCellView ?? CommitCellView.Create();

            c.Bind(_title, _message, _date, _avatar);
            return(c);
        }
        public override UITableViewCell GetCell(UITableView tv)
        {
            var c = tv.DequeueReusableCell(CommitCellView.Key) as CommitCellView ?? CommitCellView.Create();

            c.ViewModel = _viewModel;
            return(c);
        }
Beispiel #3
0
        public override float GetHeightForRow(MonoTouch.UIKit.UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
        {
            if (_usedForHeight == null)
            {
                _usedForHeight = (CommitCellView)tableView.DequeueReusableCell(CommitCellView.Key);
            }

            var item = ItemAt(indexPath) as CommitItemViewModel;

            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(CommitCellView.Key) as CommitCellView ?? CommitCellView.Create();

            cell.MaxContentLines = _lines;
            cell.Bind(_name, _description, _time, _image, _imageUri);
            return(cell);
        }
Beispiel #5
0
        public override UITableViewCell GetCell(UITableView tv)
        {
            var c    = tv.DequeueReusableCell(CommitCellView.Key) as CommitCellView ?? CommitCellView.Create();
            var time = DateTimeOffset.MinValue;

            if (_model.Commit.Committer != null)
            {
                time = _model.Commit.Committer.Date;
            }
            c.Set(_name, _description, time, _avatar);
            return(c);
        }
 public CommitTableViewSource(UITableView tableView, IReactiveNotifyCollectionChanged <CommitItemViewModel> collection)
     : base(tableView, collection, CommitCellView.Key, 64.0f)
 {
     _cache = new TableViewCellHeightCache <CommitCellView, CommitItemViewModel>(64f, () => CommitCellView.Create(true));
     tableView.RegisterNibForCellReuse(CommitCellView.Nib, CommitCellView.Key);
 }