【发布时间】:2021-05-21 06:12:36
【问题描述】:
我的问题可能听起来很傻,但我真的不知道该怎么做,因为它给了我一个错误。所以我在 ObservableCollection 中有一个包含对象的类:
public class UIElementList
{
public ObservableCollection<ChangingUIElements> ElementList { get; set; }
}
我想像这样从我的 ViewModel 类中直接访问这个类:
private UIElementList uIElementList = new UIElementList();
public UIElementList UIElementList
{
get => uIElementList.ElementList;
}
但是有些严重的错误,因为编译器给了我一个错误:
错误 CS0029 无法将类型“System.Collections.ObjectModel.ObservableCollection
【问题讨论】: