/// <summary> /// Constructor. Hooks up the event handler triggered when the timer ticks. /// </summary> /// <param name="itemsProvider">The items provider.</param> /// <param name="pageSize">Size of the page (number of items).</param> /// <param name="pageTimeout">The page timeout, in milliseconds.</param> /// <param name="loadCountInterval">The interval between count loads from the database, in milliseconds.</param> public VirtualizingCollectionDynamicAsync(IVirtualizingCollectionItemsProvider <T> itemsProvider, int pageSize, int pageTimeout, int loadCountInterval) : base(itemsProvider, pageSize, pageTimeout) { this.timer = new Timer(loadCountInterval); timer.AutoReset = false; timer.Elapsed += TimerCallback; itemsProvider.CountChanged += ItemsProvider_CountChanged; ItemsProvider_CountChanged(null, null); }
/// <summary> /// Initializes a new instance of the <see cref="VirtualizingCollectionAsync<T>"/> class. /// </summary> /// <param name="itemsProvider">The items provider.</param> /// <param name="pageSize">Size of the page.</param> /// <param name="pageTimeout">The page timeout.</param> public VirtualizingCollectionAsync(IVirtualizingCollectionItemsProvider <T> itemsProvider, int pageSize, int pageTimeout) : base(itemsProvider, pageSize, pageTimeout) { _synchronizationContext = SynchronizationContext.Current; }
/// <summary> /// Initializes a new instance of the <see cref="VirtualizingCollection<T>"/> class. /// </summary> /// <param name="itemsProvider">The items provider.</param> /// <param name="pageSize">Size of the page.</param> public VirtualizingCollection(IVirtualizingCollectionItemsProvider <T> itemsProvider, int pageSize) { _itemsProvider = itemsProvider; _pageSize = pageSize; }
/// <summary> /// Initializes a new instance of the <see cref="VirtualizingCollection<T>"/> class. /// </summary> /// <param name="itemsProvider">The items provider.</param> public VirtualizingCollection(IVirtualizingCollectionItemsProvider <T> itemsProvider) { _itemsProvider = itemsProvider; }
/// <summary> /// Initializes a new instance of the <see cref="VirtualizingCollection<T>"/> class. /// </summary> /// <param name="itemsProvider">The items provider.</param> /// <param name="pageSize">Size of the page.</param> /// <param name="pageTimeout">The page timeout.</param> public VirtualizingCollection(IVirtualizingCollectionItemsProvider <T> itemsProvider, int pageSize, int pageTimeout) { _itemsProvider = itemsProvider; _pageSize = pageSize; _pageTimeout = pageTimeout; }