This isn't an area I've had time to explore yet.
However, keeping in mind that we're dealing with an n-tier world, the solution must be generally the same as what I did in ASP.NET.
In other words, the UI provides some set of information - at least the page number and page size - through some mechanism, perhaps the IPagedViewCollection interface.
When the UI wants another page it calls a method of some sort. That method must take the page number and page size and pass them to a static factory method on the object to get the next page. The page number and page size become criteria, and are often passed through the data portal to the server so the DAL can retrieve the right page.
Presumably the IPagedViewCollection concept is n-tier and async aware, since this operation will be async regardless of what technology is used - all server calls in SL are async.
Yes - very useful. And sorry for the slow answer!
Thanks, James.
There's also the PagedList sample in CslaLight\cs that shows how to do an async paged list - and while it is a SL sample, the same technique should work on WPF and WinForms too.
Hi Rocky,
Thanks for your answer. I can't see the PagedList sample though - is it called something else (or has been removed)?
Thanks, James.
I think I wrote it for CSLA 4 - it may not be in earlier versions - though the concepts should work in 3.8 as well.
Thanks - got it now - useful to see a clean implementation like this.
Have you considered implementing IPagedCollectionView into a base list object? I'm currently working on a poor implementation of this in order to take advantage of Silverlight controls such as the DataPager, so I'm sure others will be needing similar functionality.
James.
I hesitate to add too much into core CSLA, since I am not confident that Microsoft won't come along with a solution or interface as part of .NET/SL. I'd hate to take people down one road and then have Msft move in a different direction.
It was an easy choice to embed some support for Web Forms, because Msft did define a model in that space. But since there's no formal model elsewhere yet, it is better to keep the implementations out of core CSLA I think.
Yes, I can see that makes sense (!). I guess I was assuming it came under the same category as implementing INotifyCollectionChanged (which we couldn't do without). I've hacked a solution together (that works ), but would have found things much simpler if IPagedCollectionView had also been part of CSLA. Something to keep an eye on maybe, if more 3rd party visual components emerge that assume these interfaces are implemented?
Best wishes, James.
The thing with IPagedCollectionView is that it is a view construct. It isn't the kind of interface BLB would implement, for example.
Which isn't to say it couldn't somehow be part of CSLA - perhaps kind of like the CSLA 4 LinqObservableCollection or something like that.
Makes sense. At least there's a thread on the subject now for other people searching for PagedCollectionView
Copyright (c) Marimer LLC