This definately doesn't seem like a bug and I don't know why it would be an inconsistency either.
It's the functionality of an ObservableCollection
that prevents this. The functionality guarantees that you can be notify of any changes to the ObservableCollection
. To be able to do this it needs full control changes to the underlying data structure that holds its entries.
If it would just "attach" and existing list, there is no handle for the ObservableCollection
to be notified of changes. Lets imagine the following scenario:
IList<string> someStringList = new List<string>
{
"Entry1",
"Entry2",
"Entry3"
};
var observableCollection = new ObservableCollection<string>(someStringList);
observableCollection.CollectionChanged += (sender, eventArgs) => Console.WriteLine("Something changed!");
someStringList.Add("This addition cannot be seen by the ObservableCollection!");
Which is consistent, the ObservableCollection
has created a copy, so if we look into it it will not contain the "This addition cannot be seen by the ObservableCollection!" entry.
Now if what you wanted would work (so the ObservableCollection
would have to original list "attached" instead of copied), we would have something weird. the CollectionChanged
event would not have been fired (the addition did not go through the addition of the ObservableCollection
) however if you would inspect the observableCollection
it would contain the added entry (since it was added to the "attached" list), which would make the whole thing inconsistent.
At least that's my opinion on why this was probably a design choice instead of a bug.
Hope this helps!