public static Binder <TSource, UITableView> Source <TSource, TSection, TItem, THeaderCell, TCell>(this Binder <TSource, UITableView> binder, Expression <Func <TSource, IEnumerable <IGrouping <TSection, TItem> > > > property, ICommand select = null, int heightForHeader = 44, int heightForItem = 44, bool fromNibs = true, Action <float> onScroll = null) where TSource : class where TCell : IView where THeaderCell : IView { return(binder.Source(property, (s, v, c) => { c.RegisterCellView <TCell>("cell", heightForItem); c.RegisterHeaderView <THeaderCell>("header", heightForHeader); }, new RelayConverter <IEnumerable <IGrouping <TSection, TItem> >, CollectionSource <TSource> >((x) => { var collection = new CollectionSource <TSource>(binder.Source); collection.WithSections((vm) => { return x.Select(e => { var section = new Section <TSource>(collection); section.WithHeader("header", vm2 => e.Key); section.WithCells("cell", vm2 => e, select); return section; }); }); return collection; }), fromNibs)); }
public static Binder <TSource, UITableView> Source <TSource, TItem, TCell>(this Binder <TSource, UITableView> binder, Expression <Func <TSource, IEnumerable <TItem> > > property, ICommand select = null, int heightForItem = 44, bool fromNibs = true, Action <float> onScroll = null) where TSource : class where TCell : IView { return(binder.Source(property, (s, v, c) => { c.RegisterCellView <TCell>("cell", heightForItem); }, new RelayConverter <IEnumerable <TItem>, CollectionSource <TSource> >((x) => { var collection = new CollectionSource <TSource>(binder.Source); collection.WithSection().WithCells("cell", (arg) => x, select); return collection; }), fromNibs)); }
public Section(CollectionSource <TViewModel> source) { this.source = source; }
public RecyclerViewAdapterBinding(CollectionSource <TViewModel> datasource) { this.DataSource = datasource; }
public CollectionViewSourceBinding(UICollectionView view, CollectionSource <TViewModel> datasource, bool fromNibs = true) { this.datasource = datasource; view.Delegate = new Layout(datasource); this.RegisterCells(view, fromNibs); }
public Layout(CollectionSource <TViewModel> datasource) { this.datasource = datasource; }
public RecyclerViewAdapterBinding(CollectionSource <TViewModel> datasource) { this.datasource = datasource; this.descriptors = datasource.CellViews.Union(datasource.HeaderViews).Union(datasource.FooterViews).ToList(); }
public TableViewSourceBinding(UITableView view, CollectionSource <TViewModel> datasource, bool fromNibs = true) { this.datasource = datasource; this.RegisterCells(view, fromNibs); }