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); }
// Initialisations private void DisableElements(PaginatorState pState) { DisableLeft(pState.IsValidLeft); DisableLeftMore(pState.IsValidLeftMore); DisableRight(pState.IsValidRight); DisableRightMore(pState.IsValidRightMore); }
private void Button_Click_RightMore (object sender, RoutedEventArgs e) { //PaginatorCurrentState = PaginatorCurrentState.GoRightMore(); PaginatorCurrentState = GoRightMore(PaginatorCurrentState); RenderPaginator(PaginatorCurrentState); }
// Update UI private void RenderPaginator(PaginatorState pState) { DisableElements(pState); UpdateUI_SetDataToShow(Context.GetDataStartEndIndex(pState.LeftIndexInclsv, pState.RightIndexInclsv, DbData)); UpdateUI_CurrentPageIs(pState.CurrentPage); }