예제 #1
0
        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();
        }
예제 #2
0
        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();
        }
예제 #3
0
 public void goToPage(int pageNumber)
 {
     currentPage = pages[pageNumber - 1];
     LoadCurrentPage();
 }
예제 #4
0
 public void goToFirstPage()
 {
     currentPage = pages[0];
     LoadCurrentPage();
 }
예제 #5
0
 public void goToLastPage()
 {
     currentPage = pages[pages.Count - 1];
     LoadCurrentPage();
 }
예제 #6
0
 public void decreasePage()
 {
     currentPage = pages[currentPage.PageNumber - 1];
     LoadCurrentPage();
 }
예제 #7
0
 public void increasePage()
 {
     currentPage = pages[currentPage.PageNumber + 1];
     LoadCurrentPage();
 }