Exemple #1
0
        public p_Player(IItemsProvider<IAudio> vkProvider, IItemsProvider<IAudio> cachedProvider, 
            Action whenLoginClicked,
            string userFirstName,
            bool cacheOnly)
        {
            __WhenLoginClicked = whenLoginClicked;
            __CacheOnly = cacheOnly;
            if (!__CacheOnly)
                __VkProvider =
                    new AsyncVirtualizingCollection<AudioModel>(
                        new AudioModelProviderWrapper(vkProvider, () => __CurrentActive),
                        PAGE_SIZE,
                        PAGE_TIMEOUT);

            __CachedProvider = new ItemsProviderCollectionWrapper<AudioModel>(
                new AudioModelProviderWrapper(cachedProvider, () => __CurrentActive));

            if (__CacheOnly)
                IsCacheMode = true;

            InitializeComponent();
            DataContext = this;
            AudioList = GetModelsList(__CacheOnly);
            PlayerTitle = String.Format("{0}'s music", userFirstName);
        }
        public VirtualDataCollection(IItemsProvider<IFreeDocument> data,  int pageTimeout = 30000)
            : base()
        {
            VirtualData = new VirtualizingCollection<IFreeDocument>(data,pageTimeout);

            data.AlreadyGetSize += (s, e) => OnPropertyChanged("Count");
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="VirtualizingCollection&lt;T&gt;"/> 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(IItemsProvider <T> itemsProvider, int pageSize, int pageTimeout)
 {
     _itemsProvider = itemsProvider;
     _pageSize      = pageSize;
     _pageTimeout   = pageTimeout;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="VirtualizingCollection&lt;T&gt;"/> class.
 /// </summary>
 /// <param name="itemsProvider">The items provider.</param>
 /// <param name="pageSize">Size of the page.</param>
 public VirtualizingCollection(IItemsProvider <T> itemsProvider, int pageSize)
 {
     _itemsProvider = itemsProvider;
     _pageSize      = pageSize;
 }
Exemple #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VirtualizingCollection&lt;T&gt;"/> class.
 /// </summary>
 /// <param name="itemsProvider">The items provider.</param>
 public VirtualizingCollection(IItemsProvider <T> itemsProvider)
 {
     this._itemsProvider = itemsProvider;
     // _itemsProvider.AlreadyGetSize += this.ItemsProviderAlreadyGetSize;
 }
Exemple #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VirtualizingCollection&lt;T&gt;"/> class.
 /// </summary>
 /// <param name="itemsProvider">The items provider.</param>
 public VirtualizingCollection(IItemsProvider <T> itemsProvider)
 {
     _itemsProvider = itemsProvider;
 }
Exemple #7
0
 public AsyncVirtualizingCollection(IItemsProvider <T> itemsProvider)
     : base(itemsProvider)
 {
     _synchronizationContext = SynchronizationContext.Current;
 }
Exemple #8
0
 public AsyncVirtualizingCollection(IItemsProvider <T> itemsProvider, int pageSize, int pageTimeout)
     : base(itemsProvider, pageSize, pageTimeout)
 {
     _synchronizationContext = SynchronizationContext.Current;
 }
Exemple #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VirtualizingCollection&lt;T&gt;"/> class.
 /// </summary>
 /// <param name="itemsProvider">The items provider.</param>
 protected VirtualizingCollection(IItemsProvider <T> itemsProvider)
 {
     this.itemsProvider = itemsProvider;
 }
Exemple #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VirtualizingCollection&lt;T&gt;"/> class.
 /// </summary>
 /// <param name="itemsProvider">The items provider.</param>
 /// <param name="pageSize">Size of the page.</param>
 protected VirtualizingCollection(IItemsProvider <T> itemsProvider, int pageSize)
 {
     this.itemsProvider = itemsProvider;
     this.pageSize      = pageSize;
 }
 /// <summary>
 ///     Initializes a new instance of the <see cref="VirtualizingCollection&lt;T&gt;" /> class.
 /// </summary>
 /// <param name="itemsProvider">The items provider.</param>
 public VirtualizingCollection(IItemsProvider <T> itemsProvider)
 {
     ItemsProvider = itemsProvider;
     ItemsProvider.PropertyChanged += _itemsProvider_PropertyChanged;
 }
 /// <summary>
 ///     Initializes a new instance of the <see cref="VirtualizingCollection&lt;T&gt;" /> class.
 /// </summary>
 /// <param name="itemsProvider">The items provider.</param>
 /// <param name="pageSize">Size of the page.</param>
 public VirtualizingCollection(IItemsProvider <T> itemsProvider, int pageSize)
 {
     ItemsProvider = itemsProvider;
     ItemsProvider.PropertyChanged += _itemsProvider_PropertyChanged;
     PageSize = pageSize;
 }
 public AsyncVirtualCollection(IItemsProvider <T> itemsProvider, int pageSize)
     : base(itemsProvider, pageSize)
 {
     _synchronizationContext = SynchronizationContext.Current;
 }