- Timestamp:
- Aug 12, 2011, 4:32:33 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/PiwigoLib/PiwigoWpf/DTO/AsyncObservableCollection.cs
r11911 r11935 8 8 { 9 9 public class AsyncObservableCollection<T> : ObservableCollection<T> 10 { 11 private SynchronizationContext _synchronizationContext = SynchronizationContext.Current; 10 { 12 11 13 12 public AsyncObservableCollection() … … 22 21 protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e) 23 22 { 24 if (SynchronizationContext.Current == _synchronizationContext)23 if (SynchronizationContext.Current == PwgModelManager.WPF_SynchronizationContext) 25 24 { 26 25 // Execute the CollectionChanged event on the current thread … … 30 29 { 31 30 // Send the CollectionChanged event on the creator thread 32 _synchronizationContext.Send(RaiseCollectionChanged, e);31 PwgModelManager.WPF_SynchronizationContext.Send(RaiseCollectionChanged, e); 33 32 } 34 33 } … … 42 41 protected override void OnPropertyChanged(PropertyChangedEventArgs e) 43 42 { 44 if (SynchronizationContext.Current == _synchronizationContext)43 if (SynchronizationContext.Current == PwgModelManager.WPF_SynchronizationContext) 45 44 { 46 45 // Execute the PropertyChanged event on the current thread … … 49 48 else 50 49 { 51 // Postthe PropertyChanged event on the creator thread52 _synchronizationContext.Post(RaisePropertyChanged, e);50 // Send the PropertyChanged event on the creator thread 51 PwgModelManager.WPF_SynchronizationContext.Send(RaisePropertyChanged, e); 53 52 } 54 53 }
Note: See TracChangeset
for help on using the changeset viewer.