I\'m creating a UserControl and I just can\'t remember the name of the attribute which you use to decorate the property which you want to act as the default content property. <
ContentPropertyAttribute
I also found the code for supporting collections as the content property on MSDN. TOM_C is to thank for this.
[ContentProperty("SomeObjects")]
public class SomeContainer
{
private List<SomeObject> _someObjects;
public List<SomeObject> SomeObjects
{
get
{
if (null == _someObjects)
_someObjects = new List<SomeObject>();
return _someObjects;
}
}
}
XAML:
<SomeContainer>
<SomeObject/>
<SomeObject/>
<SomeObject/>
</SomeContainer>