Example #1
0
        public async void Reload()
        {
            if (IsLoading)
            {
                return;
            }

            data.Clear();
            IsLoading = true;
            OnUpdated();

            try {
                var queryTask = query.Skip(data.Count).Take(batchSize).QueryAsync();
                var countTask = query.CountAsync();
                await Task.WhenAll(queryTask, countTask);

                data.AddRange(queryTask.Result);

                var count = countTask.Result;
                HasMore = data.Count < count;
            } finally {
                IsLoading = false;
                OnUpdated();
            }
        }