public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // instantiate our on demand collection view
            RefreshControl = new UIRefreshControl();
            var myCollectionView       = new SimpleOnDemandCollectionView();
            var myCollectionViewSource = new SimpleOnDemandCollectionViewSource(TableView);

            myCollectionViewSource.ItemsSource    = myCollectionView;
            myCollectionViewSource.RefreshControl = RefreshControl;
            TableView.Source = myCollectionViewSource;
        }
Ejemplo n.º 2
0
        public SimpleOnDemand()
        {
            InitializeComponent();

            Title = AppResources.SimpleOnDemandTitle;

            // instantiate our on demand collection view
            var myCollectionView = new SimpleOnDemandCollectionView();

            list.ItemsSource = myCollectionView;

            // start on demand loading
            list.LoadItemsOnDemand(myCollectionView);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.SimpleOnDemand);

            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);
            SupportActionBar.Title = GetString(Resource.String.SimpleOnDemandTitle);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);

            SwipeRefresh = FindViewById <SwipeRefreshLayout>(Resource.Id.SwipeRefresh);
            RecyclerView = FindViewById <RecyclerView>(Resource.Id.RecyclerView);


            _collectionView = new SimpleOnDemandCollectionView();
            RecyclerView.SetLayoutManager(new LinearLayoutManager(this));
            RecyclerView.SetAdapter(new SimpleOnDemandAdapter(_collectionView));

            SwipeRefresh.Refresh += OnRefresh;
        }