CollectionEditor 的父级
我有一个这样的属性:
[Editor(typeof(LayerCollection), typeof(UITypeEditor))]
public List<Layer> Layers { get { return layers; } }
我有一个从 CollectionEditor 派生的 LayerCollection
类。这个Layers
属性位于Canvas
类中。现在,Layer
对象需要了解作为集合父级的 Canvas
类。那么如何获得名为LayerCollection
的CollectionEditor的父级呢?
或者如果不可能,我可以在创建时向 CollectionEditor 传递一个参数吗?通过这种方式,我可以在创建时将 Canvas 对象作为参数传递给 Layer。
I have a property like that:
[Editor(typeof(LayerCollection), typeof(UITypeEditor))]
public List<Layer> Layers { get { return layers; } }
And I have a LayerCollection
class that derived from CollectionEditor. And this Layers
property is in Canvas
class. Now, the Layer
object needs to know about Canvas
class which is the parent of the collection. So how can I get the parent of the CollectionEditor named LayerCollection
?
Or if it is impossible, can I pass a parameter to the CollectionEditor when it is created? By this way I can pass the Canvas
object as a parameter to the Layer
when it is created.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
“Hans Passant”在第一篇文章的评论中回答了我的问题:
"Hans Passant" answered my question in the first post's comment: