我正在寻找一个属性编辑器的示例,例如:
public class ContainerClass
{
public string ContainerName { get; set; }
public List<ContainerBase> Containers { get; set; }
public ContainerClasss()
{
Containers = new List<ContainerBase>();
}
}
public class ContainerBase
{
public string Name { get; set; }
public string Description { get; set; }
public string Material { get; set; }
public float Area { get; set; }
}
public class Bookbag : ContainerBase
{
public int Pockets { get; set; }
public Bookbag()
{
Description = "Bookbag";
}
}
public class Bookcase : ContainerBase
{
public Color Color { get; set; }
public int Shelves { get; set; }
public Bookcase()
{
Description = "Bookcase";
}
}
当我单击 Containers 的 [...] 按钮时,[ADD] 按钮允许我添加不同类型的容器,而不是基本容器类...