Вот иерархия моего класса MyContainer
. Обратите внимание, что Panel
имеет Children
, а также MyContainer
. Могу ли я использовать Children
от Panel
?Silverlight ContentProperty на абстрактном классе Panel
В чем смысл [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;}
}