public void addNewLogin(UserLogin newLogin) { if (pages[pages.Count - 1].NumberOfElements == 8) { pages.Add(new LoginsListPage(pages.Count)); } pages[pages.Count - 1].addNewElement(newLogin); currentPage = pages[pages.Count - 1]; LoadCurrentPage(); }
public LoginsList(ItemsControl list, StackPanel navigationPanel) { this.list = list; //List<UserLogin> allLogins = list.ItemsSource as List<UserLogin>; // for (int i = 0; i < allLogins.Count; i += 8) // pages.Add(new LoginsListPage(allLogins.GetRange(i, Math.Min(8, allLogins.Count - i)).ToArray(), i / 8)); pages = new List <LoginsListPage>(); pages.Add(new LoginsListPage(0)); this.navigationPanel = navigationPanel; this.currentPage = pages[0]; this.firstPageArrow = (navigationPanel.Children[0] as Grid).Children[0] as Image; this.leftArrow = (navigationPanel.Children[0] as Grid).Children[1] as Image; this.text = (navigationPanel.Children[0] as Grid).Children[2] as TextBlock; this.rightArrow = (navigationPanel.Children[0] as Grid).Children[3] as Image; this.lastPageArrow = (navigationPanel.Children[0] as Grid).Children[4] as Image; // LoadCurrentPage(); }
public void goToPage(int pageNumber) { currentPage = pages[pageNumber - 1]; LoadCurrentPage(); }
public void goToFirstPage() { currentPage = pages[0]; LoadCurrentPage(); }
public void goToLastPage() { currentPage = pages[pages.Count - 1]; LoadCurrentPage(); }
public void decreasePage() { currentPage = pages[currentPage.PageNumber - 1]; LoadCurrentPage(); }
public void increasePage() { currentPage = pages[currentPage.PageNumber + 1]; LoadCurrentPage(); }