示例#1
0
        void InitPaginator()
        {
            var dbData = MOCK_InitializeData();

            DbData = dbData;
            var currentPage          = new IntMore0Less65535Exclsv(1);
            var itemsPerPageList     = MOCK_InitializeItemsPerPage().ToArray();
            var pagesToSkipList      = MOCK_InitializeItemsPagesToSkip().ToArray();
            var defauleSelectedIndex = 0;

            ComboBoxItemsPerPage.ItemsSource   = itemsPerPageList;
            ComboBoxItemsPerPage.SelectedIndex = defauleSelectedIndex;

            ComboBoxPagesToSkip.ItemsSource   = pagesToSkipList;
            ComboBoxPagesToSkip.SelectedIndex = defauleSelectedIndex;
            FSharpList <int> niceSharpList = ListModule.OfSeq(dbData);

            PaginatorCurrentState = Init(
                currentPage,
                itemsPerPageList[defauleSelectedIndex],
                pagesToSkipList[defauleSelectedIndex],
                Context.GetTotalNumberOfItemsInDB(dbData)
                );

            RenderPaginator(PaginatorCurrentState);
        }
示例#2
0
 // Initialisations
 private void DisableElements(PaginatorState pState)
 {
     DisableLeft(pState.IsValidLeft);
     DisableLeftMore(pState.IsValidLeftMore);
     DisableRight(pState.IsValidRight);
     DisableRightMore(pState.IsValidRightMore);
 }
示例#3
0
 private void Button_Click_RightMore
     (object sender, RoutedEventArgs e)
 {
     //PaginatorCurrentState = PaginatorCurrentState.GoRightMore();
     PaginatorCurrentState = GoRightMore(PaginatorCurrentState);
     RenderPaginator(PaginatorCurrentState);
 }
示例#4
0
 // Update UI
 private void RenderPaginator(PaginatorState pState)
 {
     DisableElements(pState);
     UpdateUI_SetDataToShow(Context.GetDataStartEndIndex(pState.LeftIndexInclsv, pState.RightIndexInclsv, DbData));
     UpdateUI_CurrentPageIs(pState.CurrentPage);
 }