Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help needed getting started in the right direction

1 view
Skip to first unread message

Billy B

unread,
Apr 16, 2009, 11:44:03 PM4/16/09
to
I have created a class in a windows project as follows:

Public Class CachedCollection _
(Of T As {Class, New, INotifyPropertyChanged, IReportEditState})
Implements IBindingList, ITypedList, IEnumerable(Of T)

This class implements IBindingList so that it can serve as the data source
to a BindingSource object.
This class is essentially just a wrapper class around a cache of records and
allows the BindingSource
object to treat my collection (the entire table in an sql server db -
500,000 rows or more) as a single logical
collection, when in reality I'm only keeping around 50 records in the cache.

All pretty standard stuff and works perfectly in the windows project, But....

Now I'm trying to use this same class in a WPF project.

Essentially, the problem is the the System.Windows.Binding object that I'm
using
to bind by class and the controls (i.e. textboxs ect.) calls CopyTo on my
class which is
implemented to satisfy the ICollection interface.

I do not want the Binding obect to get a copy of my collection, as my
collection is
fairly large, hence the need for cache-ing. In the windows project the
System.Windows.Forms.BindingSource just calls Item() with the index of the
desired
item in my collection.

So the quection is: how can I Implement a cache in WPF(C#) and hopefully
with out
having to rewrite every line of code from the windows project?????

Does the System.Windows.Binding object always try to get a copy of my
collection
or is there some way to control this behavior???

If someone could just point me in the general direction I would really
appreciate it. THANK YOU.

0 new messages