Hello,
i have a problem with ListCollectionView.
Tried to update the items of ListCollectionView through a event, which has been fired by EventAggregator. It seems to be the problem, that i fired the event from View-A and want to update the ListCollecitonView in the View-B. So i got always the exception about Dispatcher-Thread.
From ViewModel-A:
mEventAggregator.GetEvent<DataChanged<DataType>().Publish(changedData);
From ViewModel-B:
mEventAggregator.GetEvent<DataChangedEvent<DataType>>().Subscribe(UpdateDataMethod); private void UpdateDataMethod(DataType changedData) { var found = this.UIViewModel.DataCollectionView.OfType<DataType>().FirstOrDefault( item=> item.ID == changedData.ID ); if(found!=null) { this.UIViewModel.DataCollectionView.Remove( found ); } }
Any help will be thankful!