From 7d7281f91edfb2d0e7d0e92bd282403f0426f94d Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 26 Aug 2018 20:09:38 +0300 Subject: Added new colorized static text widget to tech board. Added option to go back to job/jobs from running job view. Fixed issue with bug reporting. Fixed other bugs. --- .../Tango.Core/SynchronizedObservableCollection.cs | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Software/Visual_Studio/Tango.Core/SynchronizedObservableCollection.cs (limited to 'Software/Visual_Studio/Tango.Core/SynchronizedObservableCollection.cs') diff --git a/Software/Visual_Studio/Tango.Core/SynchronizedObservableCollection.cs b/Software/Visual_Studio/Tango.Core/SynchronizedObservableCollection.cs new file mode 100644 index 000000000..f0a13b3c9 --- /dev/null +++ b/Software/Visual_Studio/Tango.Core/SynchronizedObservableCollection.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Collections.Specialized; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Threading; + +namespace Tango.Core +{ + public class SynchronizedObservableCollection : ObservableCollection + { + public SynchronizedObservableCollection() : base() + { + this.EnableCrossThreadOperations(); + } + + public SynchronizedObservableCollection(IEnumerable collection) : base(collection) + { + + } + + protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e) + { + if (ObservableEntityCollectionSettings._dispatcher != null) + { + ObservableEntityCollectionSettings._dispatcher.BeginInvoke(new Action(() => + { + base.OnCollectionChanged(e); + })); + } + else + { + base.OnCollectionChanged(e); + } + } + } +} -- cgit v1.3.1