Hi Guys,
Here is a hierarchy of my class MyContainer
. Notice that the Panel
has a Children
as well as MyContainer
. Can I still use the Children
from Panel
as well?
What is the meaning of [ContentProperty("Children", true)]
? The summary explains:
Specifies which property of a class can be interpreted to be the content property when the class is parsed by a XAML processor.
But I am not understanding what he means?
[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;}
}