Beispiel #1
0
        protected override async Task LoadMoreContent()
        {
            await Task.Run(async() =>
            {
                var dataSource = await VmService.LoadReviews(LOADING_REVIEWS_COUNT, Reviews.Count);

                CanLoadMore = !dataSource.IsNullOrEmpty() && dataSource.Count == LOADING_REVIEWS_COUNT;
                LoadMoreCommand.RaiseCanExecuteChanged();

                InvokeOnMainThread(() => Reviews.AddRange(dataSource));
            });
        }
Beispiel #2
0
        protected override async Task LoadContent()
        {
            Loading = true;

            Items = await VmService.LoadPoints(SearchText, 0, LOADING_COUNT);

            CanLoadMore = !Items.IsNullOrEmpty() && Items.Count >= LOADING_COUNT;

            LoadMoreCommand.RaiseCanExecuteChanged();

            Loading = false;
        }
Beispiel #3
0
        protected virtual async Task LoadContent()
        {
            Loading = true;

            var dataSource = await VmService.LoadReviews(LOADING_REVIEWS_COUNT);

            InvokeOnMainThread(() => Reviews = dataSource);

            CanLoadMore = !dataSource.IsNullOrEmpty() && dataSource.Count == LOADING_REVIEWS_COUNT;
            LoadMoreCommand.RaiseCanExecuteChanged();

            Loading = false;
        }
Beispiel #4
0
        protected override Task LoadMoreContent()
        {
            return(Task.Run(async() =>
            {
                var moreItems = await VmService.LoadPoints(SearchText, Items?.Count ?? 0, LOADING_COUNT);

                InvokeOnMainThread(() => Items.AddRange(moreItems));

                CanLoadMore = !moreItems.IsNullOrEmpty() && moreItems.Count == LOADING_COUNT;

                LoadMoreCommand.RaiseCanExecuteChanged();
            }));
        }
Beispiel #5
0
        protected override async Task LoadItems()
        {
            Loading = true;

            var dataSource = await VmService.LoadMarkedProducts(LOADING_PRODUCTS_COUNT);

            InvokeOnMainThread(() =>
            {
                Items = dataSource;
                Empty = Items.IsNullOrEmpty();
            });

            CanLoadMore = !dataSource.IsNullOrEmpty() && dataSource.Count == LOADING_PRODUCTS_COUNT;
            LoadMoreCommand.RaiseCanExecuteChanged();

            Loading = false;
        }
        protected override async Task LoadMoreContent()
        {
            if (Loading || LoadingMore)
            {
                return;
            }

            LoadingMore = true;

            var dataSource = await VmService.LoadHistoryOrders(LOADING_ORDERS_COUNT, offset : Orders.Count);

            CanLoadMore = !dataSource.IsNullOrEmpty() && dataSource.Count == LOADING_ORDERS_COUNT;
            LoadMoreCommand.RaiseCanExecuteChanged();

            InvokeOnMainThread(() =>
            {
                Orders.AddRange(dataSource);
            });

            LoadingMore = false;
        }
Beispiel #7
0
        protected override void OnLoadMoreExecute()
        {
            if (Loading || LoadingMore)
                return;

            Task.Run(async () =>
            {
                LoadingMore = true;

                var dataSource = await VmService.LoadMarkedProducts(LOADING_PRODUCTS_COUNT, Items.Count);

                CanLoadMore = !dataSource.IsNullOrEmpty() && dataSource.Count == LOADING_PRODUCTS_COUNT;
                LoadMoreCommand.RaiseCanExecuteChanged();

                InvokeOnMainThread(() =>
                {
                    Items.AddRange(dataSource);
                    Empty = Items.IsNullOrEmpty();
                });

                LoadingMore = false;
            });
        }
Beispiel #8
0
 private void ResultChangeset_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
 {
     LoadMoreCommand.RaiseCanExecuteChanged();
 }