Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/335.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 将ObservableCollection转换为ObservableCollection_C#_Collections_Generic Collections - Fatal编程技术网

C# 将ObservableCollection转换为ObservableCollection

C# 将ObservableCollection转换为ObservableCollection,c#,collections,generic-collections,C#,Collections,Generic Collections,我有一个明显的收集。T有一个ToString方法。我想做的是将ObservableCollection转换为ObservableCollection。在快速搜索之后,我发现了几篇文章建议使用foreach方法——还有其他方法吗?e、 g: myCollection.ToObservableCollection(); var newCollection = new ObservableCollection<string>(myCollection.Select(x => x.T

我有一个明显的收集。T有一个ToString方法。我想做的是将ObservableCollection转换为ObservableCollection。在快速搜索之后,我发现了几篇文章建议使用foreach方法——还有其他方法吗?e、 g:

myCollection.ToObservableCollection();
var newCollection = new ObservableCollection<string>(myCollection.Select(x => x.ToString()));