protected override IPageLoadingBehaviorCollectionBuilder <TViewModel, ISlidingWindow <TViewModel> > CreateInitialBuilder( int pageSize, IScheduler notificationScheduler, IScheduler backgroundScheduler) { return(SlidingWindowBuilder.Build <TViewModel>( _slidingWindowOptionsViewModel.WindowSize, _slidingWindowOptionsViewModel.WindowOffset, pageSize, notificationScheduler, backgroundScheduler)); }
internal static ISlidingWindow <T> CreateCollectionWithCustomPageFetchingLogicAndCustomLeastRecentlyUsed <T>( PageLoadingBehavior pageLoadingBehavior, PageRemovalBehavior pageRemovalBehavior, FetchersKind fetchersKind, IndexAccessBehavior indexAccessBehavior, int count, int pageSize, int initialWindowSize, int initialWindowOffset, Func <int, int, T[]> pageFetchingLogic, T placeholder, int pageLimit, int removalCount, IScheduler scheduler) { var pageLoadingBehaviorCollectionBuilder = SlidingWindowBuilder.Build <T>( initialWindowSize, initialWindowOffset, pageSize, new EventLoopScheduler(), scheduler); var pageHoldingBehaviorCollectionBuilder = StandardPageHoldingBehaviorCollectionBuilder( pageLoadingBehaviorCollectionBuilder, pageLoadingBehavior, (_, __) => placeholder); var fetchersKindCollectionBuilder = StandardFetcherKindCollectionBuilder( pageHoldingBehaviorCollectionBuilder, pageRemovalBehavior, pageLimit, removalCount); var indexAccessBehaviorCollectionBuilder = StandardIndexAccessBehaviorCollectionBuilder( fetchersKindCollectionBuilder, fetchersKind, pageFetchingLogic, () => count); var dataVirtualizingCollection = StandardDataVirtualizingCollection( indexAccessBehaviorCollectionBuilder, indexAccessBehavior, () => placeholder); return(dataVirtualizingCollection); }
internal static ISlidingWindow <int> CreateCollectionWithIncrementalIntegerWhereFetchersIgnorePageSize( PageLoadingBehavior pageLoadingBehavior, PageRemovalBehavior pageRemovalBehavior, FetchersKind fetchersKind, IndexAccessBehavior indexAccessBehavior, int count, int pageSize, int initialWindowSize, int initialWindowOffset, IScheduler scheduler) { var pageLoadingBehaviorCollectionBuilder = SlidingWindowBuilder.Build <int>( initialWindowSize, initialWindowOffset, pageSize, new EventLoopScheduler(), scheduler); var pageHoldingBehaviorCollectionBuilder = StandardPageHoldingBehaviorCollectionBuilder( pageLoadingBehaviorCollectionBuilder, pageLoadingBehavior, (_, __) => - 1); var fetchersKindCollectionBuilder = StandardFetcherKindCollectionBuilder( pageHoldingBehaviorCollectionBuilder, pageRemovalBehavior, 10, 1); var indexAccessBehaviorCollectionBuilder = StandardIndexAccessBehaviorCollectionBuilder( fetchersKindCollectionBuilder, fetchersKind, (offset, pSize) => Enumerable .Range(offset, pageSize) // <--- This is different! pageSize instead of pSize! .ToArray(), () => count); var dataVirtualizingCollection = StandardDataVirtualizingCollection( indexAccessBehaviorCollectionBuilder, indexAccessBehavior, () => - 1); return(dataVirtualizingCollection); }
internal static ISlidingWindow <int> CreateCollectionWithCustomCountFetcher( PageLoadingBehavior pageLoadingBehavior, PageRemovalBehavior pageRemovalBehavior, FetchersKind fetchersKind, IndexAccessBehavior indexAccessBehavior, Func <int> countFetcher, int pageSize, int initialWindowSize, int initialWindowOffset, IScheduler scheduler) { var pageLoadingBehaviorCollectionBuilder = SlidingWindowBuilder.Build <int>( initialWindowSize, initialWindowOffset, pageSize, new EventLoopScheduler(), scheduler); var pageHoldingBehaviorCollectionBuilder = StandardPageHoldingBehaviorCollectionBuilder( pageLoadingBehaviorCollectionBuilder, pageLoadingBehavior, (_, __) => - 1); var fetchersKindCollectionBuilder = StandardFetcherKindCollectionBuilder( pageHoldingBehaviorCollectionBuilder, pageRemovalBehavior, 10, 1); var indexAccessBehaviorCollectionBuilder = StandardIndexAccessBehaviorCollectionBuilder( fetchersKindCollectionBuilder, fetchersKind, (offset, pSize) => Enumerable .Range(offset, pSize) .ToArray(), countFetcher); var dataVirtualizingCollection = StandardDataVirtualizingCollection( indexAccessBehaviorCollectionBuilder, indexAccessBehavior, () => - 1); return(dataVirtualizingCollection); }