I do not understand how the DefaultProperty Metadata tag work or what it signifies.
I’ve read the MSDN and went through the sample but I find it confusing.
DefaultPropertyAttribute Class
I’ve read a few blogs and they seem to refer to the indexers. I’m not sure why you would want metadata for your properties? I am coming from a Java background, perhaps a Java analogy would help.
[DefaultProperty("Value")]
public abstract class FOO<T> : ANY, IBAR<T>
{
public FOO() { }
public FOO(T value) { this.Value = value; }
public virtual T Value { get; set; }
}
Follow up: Property Grid
This is used for property grids.
When you select a component in the designer, it looks for a
DefaultPropertyattribute and selects that property by default.You can safely ignore it.
The
DefaultEventattribute is similar.