0
以下是我的類MyContainer
的層次結構。請注意0有一個Children
以及MyContainer
。我還可以使用Panel
的Children
嗎?關於抽象類面板上的Silverlight ContentProperty
[ContentProperty("Children", true)]
是什麼意思?概要說明:
指定哪個類 的屬性可以被解釋爲內容 屬性當類由 XAML處理器解析。
但我不明白他的意思?
[ContentProperty("Children", true)]
public abstract class Panel : FrameworkElement
{
//
// Summary:
// Gets the collection of child elements of the panel.
//
// Returns:
// The collection of child objects. The default is an empty collection.
public UIElementCollection Children { get; }
}
public class Canvas : Panel
{....}
public class MyContainer : Canvas
{
public MyContainer();
public ObservableCollection<MyObject> Children {get;}
}