'What mean copy in ObservableCollection<T>(List<T>) documentation
I have 2 containers as:
List<T>
ObservableCollection<T>
I construct the ObservableCollection<T> containers with a filtred part of List<T>. I took a look the documentation of the constructor: ObservableCollection<T>(List<T>) here.
In this docummentation this is write:
Initializes a new instance of the ObservableCollection class that contains elements copied from the specified list.
But I don't know if the word copied mean real memory copy or referencing the value of item in the List<T> into the ObservableCollection<T> ?
Solution 1:[1]
As said in the comment @Ralf:
That depends of what T is. For a valuetype you get a copy. For a referencetype you still reference the same object.
More info about ReferenceType and ValueType
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | DipStax |
