在后台线程上更新业务对象集合时,我收到此错误消息:
This type of CollectionView does not support changes to its SourceCollection from a thread different from the Dispatcher thread.
好吧,这是有道理的。但它也引出了一个问题,什么版本的 CollectionView 确实支持多线程以及如何让我的对象使用它?
最佳答案
用途:
System.Windows.Application.Current.Dispatcher.Invoke(
System.Windows.Threading.DispatcherPriority.Normal,
(Action)delegate()
{
// Your Action Code
});
关于.net - 我在哪里可以获得线程安全的 CollectionView?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2137769/