Пример #1
0
        private void InitializeFooSource()
        {
            NoMoreFoos = false;
            fooSource  = new FooSource(async(currentPage, itemsPerPage) =>
            {
                FooResponse response = null;
                try
                {
                    IsLoading = true;
                    response  = await fooService.GetFoos(currentPage, itemsPerPage);
                }
                catch (Exception ex)//Something completely unexpected happened, write a debug line to ensure persistence of the error
                {
                    //TODO ERROR HANDLING
                }
                finally
                {
                    IsLoading = false;//Hide the progressbar
                }
                return(response);
            });

            this.Foos = new IncrementalCollection <FooSource, Foo>(fooSource);
            this.Foos.HasMoreItemsChanged += (s, hasm) =>
            {
                this.NoMoreFoos = !hasm.HasMoreItems;
            };
        }