Suppose I have a custom control that has a nested child property group, like this:
<cc1:mycontrol [properties]>
<childpropertyname [properties]>
</childpropertyname>
</cc1:mycontrol>
I attempted to setup a skin that sets a property in <childpropertyname>. I receive the compiler error "Control skins cannot contain child controls". (Please assume that the syntax of the main control definition is fine and there are no errors if I omit <childpropertyname>.) While the child property is indeed a control, its still a property declaration syntax as if I had defined some other non-control object.
1. Can I declare any form of child property in a skin or is it limited to the top level?
2. What are the requirements for a child property to work with a skin?
3. Is this a bug since its a child property that happens to be a control class?
Background:
In my example, the <childpropertyname> is actually another WebControl whose properties are exposed and uses these attributes to define itself:
[PersistenceMode(PersistenceMode.InnerProperty)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
Plus it has [ParseChildren(false)] and [PersistChildren(false)], and uses AddParsedSubObject() to assign the child control to that property. A ControlBuilder maps the <childpropertyname> to the object instance used by that property.
--- Peter Blum
Creator of Professional Validation And More Suite, Peter's Date Package, and Peter's Polling Package
www.PeterBlum.com