-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question regarding implementing an IPagedSourceProviderAsync provider #3
Comments
Yes, don't do it this way ! Use .add rather than reset if you can with something ( I think that's what you mean by paging) as a backing store. It works much faster that way, and p.s. .Add is thread safe. Here is why - if the item is out of scope that you added, no events are raised from the observable, where as reset async always raises the most expensive event on the observable. Sent from my iPhone
|
So I would use the provider GetItemsAtAsync call to retrieve the additional rows (could be 1000 or so) and use the .add or .addrange methods of the collection? |
Hum.. I have not tried that .. But, yes. Sent from my iPhone
|
This is what I attempted:
The AddRange call ends up invoking a call to the GetItemsAt method on the provider. Since this is an async provider, GetItemsAt is not implemented. |
Hum.. You are right.. Let me think on that one.
|
I must be approaching this the wrong way. |
Let me mull on this over the weekend when I have some time.... The problem is that you don't know the size of the collection, until you get to the end, and you don't want the whole collection in memory so you can't just poke it into a List... Interesting problem..
|
Could you post me the class for the provider that you are using ? Sent from my iPhone
|
|
While calling |
Hi! Have you solved the issue with notification subscription in PaginationManager? I have a similar use-case that would really benefit from this functionality. I have a very large collection of models that I need to display (lets say around a million) , it is very noneffective to create VM for every model in collection so I wanted to use VirtualizionObservableCollection and its IPagedSourceProvider to create VMs only on demand when the UI wants to display them. |
My UI app listens for the CountChanged event that is raised by my provider. On the CountChanged event I issue a ResetAsync() on the collection. For my scenario that works fine. |
I've implemented an IPagedSourceProviderAsync for reading large text files. The provider runs a task that reads the file to create pages of data to be used by the GetItemsAtAsync task. The provider periodically raises an event to update the total row count so that more records can be displayed. This event is captured by my view model which does a ResetAsync on the collection. Is there a better way to notify the collection that the provider's count property has been updated so that the collection can update itself?
The text was updated successfully, but these errors were encountered: