| 31 | } |
| 32 | |
| 33 | void ListView::bindViewCore() |
| 34 | { |
| 35 | View::bindViewCore(); |
| 36 | auto listCore = core<ListView::Core>(); |
| 37 | listCore->dataSource.bind(dataSource); |
| 38 | listCore->selectedRowIndex.bind(selectedRowIndex); |
| 39 | listCore->enableRefresh.bind(enableRefresh); |
| 40 | listCore->enableSwipeToDelete.bind(enableSwipeToDelete); |
| 41 | listCore->listView = std::static_pointer_cast<ListView>(shared_from_this()); |
| 42 | |
| 43 | _refreshCallback = listCore->_refreshCallback.set([this]() { onRefresh().notify(); }); |
| 44 | _deleteCallback = listCore->_deleteCallback.set([this](int index) { onDelete().notify(index); }); |
| 45 | } |
| 46 | |
| 47 | Notifier<> &ListView::onRefresh() { return _refreshNotifier; } |
| 48 | } |