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

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

            myCollectionViewSource.ItemsSource    = myDataCollection;
            myCollectionViewSource.RefreshControl = RefreshControl;
            TableView.Source = myCollectionViewSource;
        }
Example #2
0
        public SimpleOnDemand()
        {
            InitializeComponent();

            Title = AppResources.SimpleOnDemandTitle;

            // instantiate our on demand collection view
            var myDataCollection = new SimpleOnDemandDataCollection();

            list.ItemsSource = myDataCollection;

            // start on demand loading
            list.LoadItemsOnDemand(myDataCollection);
        }
Example #3
0
        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);


            _dataCollection = new SimpleOnDemandDataCollection();
            RecyclerView.SetLayoutManager(new LinearLayoutManager(this));
            RecyclerView.SetAdapter(new SimpleOnDemandAdapter(_dataCollection));

            SwipeRefresh.Refresh += OnRefresh;
        }