public override void RowSelected(UITableView tableView, NSIndexPath indexPath) { if (indexPath.Section == 1) { InvokeOnMainThread(LoadingIndicator.Instance.StartLoading); model.LoadMore(() => { controller.LoadMore(); InvokeOnMainThread(LoadingIndicator.Instance.StopLoading); }); } }
private TextColoringAdapterWithLoadMoreButton CreateListAdapter() { var from = new[] { "User", "Msg", "Date" }; var to = new[] { Ids.LatestCommitsWidget_ChangesetUser, Ids.LatestCommitsWidget_ChangesetText, Ids.LatestCommitsWidget_ChangesetDate }; var listItems = CreateListItems(); var layout = Resource.Layout.LatestCommitsWidget_ListItem; var adapter = new TextColoringAdapterWithLoadMoreButton(Context, listItems, layout, from, to, GetHighlightColor()); adapter.LoadMoreClick += (o, e) => { scrollDown = true; GC.Collect(0); //LoadMore is expensive memory wise, so we do a minor GC here model.LoadMore(() => ((Activity)Context).RunOnUiThread(Redraw)); }; return(adapter); }
public void LoadMore() { IsLoading = true; model.LoadMore(() => Deployment.Current.Dispatcher.BeginInvoke(StoreDataFromModel)); }