Collections
iOS
All Binbable*
sources work with reusable cells, for that must be declared before use:
- Registering cell as reusable:
Table\CollectionView.RegisterNibForCellReuse(ItemViewCell.Nib, ItemViewCell.Key);
- Inherit
BindableTableViewCell
,BindableCollectionViewCell
,BindableTableViewHeaderFooterView
,BindableUICollectionReusableView
or any custom cell withIBindableView
interface.
More samples about using those sources you can see in our Playground.
UITableViewSource
var source = new BindableTableViewSource<ItemViewModel, ItemViewCell>(ViewModel.Items);
var source = new BindableTableViewSource<HeaderViewModel, ItemViewModel, HeaderViewCell, ItemViewCell>(TableView, ViewModel.Items);
UICollectionViewSource
var source = new BindableCollectionViewSource<ItemViewModel, ItemViewCell>(ViewModel.Items);
Android
All Binbable*
adapters work with reusable ViewHolders, for that must be declared before use:
- Inherit BindableViewHolder, or any custom ViewHolder with IBindableViewHolder interface.
- Add BindableViewHolderLayout attribute for auto-inflating ViewHolder layout.
More samples about using those sources you can see in our Playground.
var adapter = new BindableRecyclerViewAdapter<ItemViewModel, ItemViewHolder>(ViewModel.Items);
var adapter = new BindableRecyclerViewAdapter<HeaderViewModel, ItemViewModel, ItemViewHolder>(
items: ViewModel.Items,
headerViewHolder: typeof(HeaderViewHolder));