views:

366

answers:

1

So, I've spent a good amount of time using ContinuousLinq to bind collections to WPF using LINQ in my client app. Now I get to testing and find out that ComboBoxes do not support collection change notifications cross-thread.

Does anyone know of a Bindable LINQ solution that has an option to force change event to be raised on a given UIThread?

+1  A: 

Since ContinuousLinq is open source, you could modify it to add this behavior...

Here's an example of how to do it with an ObservableCollection. You could probably use the same principle for ContinuousLinq.

Thomas Levesque
I'm a VB.Net coder so I'm a slow reader of C# and an even worse writer. I sis find another simple example of how to override the ObservableCollection but I just cant get one part to work in VBBasically, I GetInvocationList of the CollectionChanged event but cannot figure out how to do this in VB.Dim eventHandler As System.Collections.Specialized.NotifyCollectionChangedEventHandler = CollectionChanged
JoshKraker
Is what I translated the C# to but this line gives me an error saying that CollectionChanged is an event and cannot be called directly. How can I get the invocation list of an event in VB.NET?
JoshKraker
Ok, I just went with your first suggestion. I found the area in ContinuousLinq that raises the events and found that it was in fact already using a Dispatcher that was assigned from teh thread that instantiated the collection. I added a property to the collection that would allow me to set my own dispatcher. Thanks for the advice Tom.
JoshKraker
Sorry for not answering sooner, I was asleep... Anyway, it seems you found the solution ;)
Thomas Levesque