Threading issues, settter with ObservableCollection and ListCollectionView
I need assistance in understanding what is happening please.
I have an ObservableCollection which I would like to filter according to certain buttons being clicked. (Complete/Busy for example)
Now I created a ListCollectionView inside the set to handle the filtering, so the ListCollectionView will be shown on the UI while the ObservableCollection will be used as the data source.
The issue with this is the concept that I'd be creating a new ListCollectionView everytime the set is hit (everytime the
DisplayList
is changed)
Here is the snippet of code:
Upon trying to initialize my ListCollectionView in the contructor, I ended up with the following code:
I now get a threading issue upon trying to refresh. I am unsure what is happening.2 Replies
how are you calling this constructor, have you tried to run it on the UI thread explicitely?
try with
Dispatcher.Invoke()
It's just my view model:
It gets called in my
xaml.cs
file