msedi
msedi

Reputation: 1743

CollectionView without a dispatcher

I need a sorting, grouping and filtering behavior of a CollectionView also with LiveShaping properties, but every .NET implementation has a Dispatcher connected to it.

Is there any implementation of the ICollectionView without a dispatcher?

Upvotes: 0

Views: 236

Answers (2)

mm8
mm8

Reputation: 169280

Is there any implementation of the ICollectionView without a dispatcher?

No, there isn't. The only class that implements this interface in the .NET Framework is the CollectionView class and it is a DispatcherObject.

So you will have to provide your own implementation or solve your issue in a different way.

Upvotes: 1

Rekshino
Rekshino

Reputation: 7325

From MSDN:

Remarks:

The interface is implemented by the CollectionView class, which is the base class for BindingListCollectionView, ListCollectionView, and ItemCollection.

CollectionView derives from System.Windows.Threading.DispatcherObject, so this class and all derived will always have Dispatcher property, because Dispatcher property is not virtual, abstract or override, other way you could mark it as sealed and use a derived class without Dispatcher property.

Other remark for CollectionView:

Remarks:

You should not create objects of this class in your code. To create a collection view for a collection that only implements IEnumerable, create a CollectionViewSource object, add your collection to the Source property, and get the collection view from the View property.

It is not a solution of your problem, but an answer on your question.

Upvotes: 1

Related Questions