I fear I may already know the answer to this question but I'm holding out the smallest glimmer of hope that I am wrong.
I have repository that contains a Collection Property with a list of Items. This collection is updated from a webservice call that does 1 of 2 things. If it is the first call it will create a new instance of an Item for each row returned, populate it, and add it to the Collection. Subsequent calls instead look for that item in the collection and update its properties. The ViewModel, Item Class, and Repository implement INotifyPropertyChanged.
The call to the dataservice executes every 30 seconds updating the data using async / await with a Task similar to this: How to execute a method periodically from WPF client application using threading or timer. The ViewModel takes the items from the repositorys Collection and splits them into various collection properties. The View then binds via an ItemsControl to the individual items in each collection and properties are continually updated.
It all works beautifully... but, the DataService Call isn't in its own thread and despite the async/await the UI gets a little unresponsive about every 30 seconds. When I went to put the DataService call in a BackgroundWorker I realized I can't when it threw an exception about modifying from a different thread.
I am familar with this issue from WinForms but I was hoping to somehow sidestep it with WPF and twoway binding. Is there a way to make the UI more responsive with just async/await or is there a way put the updates in a thread without having to write the events to support a dispatcher to do the updates on the main thread?