I have a bit of a weird situation, I've implemented a ObservableConcurrentDictionary (based on the ConcurrentDictionary from .NET), which I used to implement ObservableConcurrentCollection (which just automatically sets the Key property in the Dictionary, and has all the IList, IEnumerable, IQueryable and ICollection methods). This is all working fine when I do something like:
ObservableConcurrentCollection<string> items = new ObservableConcurrentCollection<string>();
dataGrid.ItemsSource = items;
items.Add("TEST");
This is reflected perfectly in the DataGrid.
However, when I do this:
ObservableConcurrentCollection<string> items = new ObservableConcurrentCollection<string>();
items.Add("TEST"); // <-- Notice that this and the line below are swapped.
dataGrid.ItemsSource = items;
It's not working correctly as an item from 'items' suddenly became a KeyValuePair. I can easily fix this by using dataGrid.ItemsSource = items.Values in the last line, but I'd rather have it working just like the previous one (and it's also confusing).