コード例 #1
0
        private void InitializeGroupedFooSource()
        {
            NoMoreGroupedFoos = false;
            groupedFooSource  = new GroupedFooSource(async(currentPage, itemsPerPage) =>
            {
                GroupedFooResponse response = null;
                try
                {
                    IsLoading = true;
                    response  = await fooService.GetGroupedFoos(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.GroupedFoos = new IncrementalCollection <GroupedFooSource, GroupModel <string, Foo> >(groupedFooSource);
            this.GroupedFoos.HasMoreItemsChanged += (s, hasm) =>
            {
                this.NoMoreGroupedFoos = !hasm.HasMoreItems;
            };
        }