public MainViewModel(int categoriesId)
        {
            Items = new InfiniteScrollCollection <Products>
            {
                OnLoadMore = async() =>
                {
                    var items = new InfiniteScrollCollection <Products>();
                    if (totalcount > getEventCount && getEventCount != 0 || IsFirstHit == false || totalcount == 0)
                    {
                        if (!HitinProcess)
                        {
                            HitinProcess  = true;
                            IsLoadingMore = true;

                            var response = await CommonLib.CategoryProductList(CommonLib.ws_MainUrl + "AccountApi/GetProducts?id=" + categoriesId + "&pageIndex=" + pageindex + "&pageSize= " + pageSize + "");

                            if (response != null && response.products.Count != 0 && response.Count != 0)
                            {
                                pageindex++;
                                IsFirstHit    = true;
                                totalcount    = response.Count;
                                getEventCount = response.products.Count;
                                items         = GetItems(true, response.products);
                                IsLoadingMore = false;
                                HitinProcess  = false;
                            }
                            else
                            {
                                getEventCount = 0;
                                HitinProcess  = false;
                                IsLoadingMore = false;
                            }
                        }
                    }
                    //Call your Web API next items page.
                    //if (!ProductCategories.IsPull)
                    //    await Task.Delay(1200);

                    return(items);
                }
            };
            Items.LoadMoreAsync();
        }