ObservableCollection(List) 文档中的复制是什么意思
我有 2 个容器:
List<T>
ObservableCollection<T>
我使用 List
的过滤部分构造 ObservableCollection
容器。我查看了构造函数的文档: ObservableCollection
此处。 在这个文档中这样写:
初始化 ObservableCollection 类的新实例,其中包含从指定列表复制的元素。
但我不知道 copied
这个词是否意味着真正的内存复制或将 List
中的项目值引用到 ObservableCollection
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>
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

正如评论@Ralf 中所说:
有关 ReferenceType 和 < a href="https://learn.microsoft.com/fr-fr/dotnet/api/system.valuetype?view=net-6.0" rel="nofollow noreferrer">ValueType
As said in the comment @Ralf:
More info about ReferenceType and ValueType