protected Page GetPage(List <string> pageIndexes, IPageManager pageManager, int index, Dictionary <string, int> initialIndexDictionary, out int pageIndex, object parent) { Page page; pageIndex = 0; if (pageIndexes.Count < 1) { //If there are no pages, we have to create the first page for the virtual list. page = pageManager.CreateNewPage(parent); initialIndexDictionary.Add(page.UniqueID, index); } else { pageIndex = (index == pageIndexes.Count) ? index - 1 : index; page = pageManager.LoadPage(pageIndexes[pageIndex] as string); } return(page); }