Exemplo n.º 1
0
 public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
 {
     if (indexPath.Section == 1)
     {
         InvokeOnMainThread(LoadingIndicator.Instance.StartLoading);
         model.LoadMore(() => {
             controller.LoadMore();
             InvokeOnMainThread(LoadingIndicator.Instance.StopLoading);
         });
     }
 }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 public void LoadMore()
 {
     IsLoading = true;
     model.LoadMore(() => Deployment.Current.Dispatcher.BeginInvoke(StoreDataFromModel));
 }