Some common mistakes that will cause the designer to choke while persisting collection properties are:
Category
Some common mistakes that will cause the designer to choke while persisting collection properties are:
Nested properties in your controls should be marked with the NotifyParentProperty(true) attribute in order for the designer to get notified that it’s value has changed.
For example, the following property (SubProperty) declaration should include the above mentioned attribute, for the designer to persist changes to that property during design-time:
myControl.SomeComplexProperty.SubProperty = 'some value';
PermalinkAll string type properties get saved as attributes of the parent tag inspite of the InnerProperty attribute setting. In fact, setting the InnerProperty attribute might prevent the property from getting saved at all.
For example, in the property declaration below:
[C#]
[
Category('Appearance'),
NotifyParentProperty(true),
PersistenceMode(PersistenceMode.Attribute), // This should always be Attribute, not anything else like InnerProperty.
]
public string Text{get{return text;}set{text = value;}}
Permalink