Re: DefaultValue Attribute
Makes perfect sense. What namespace is the DefaultvalueAttribute a member of? System.ComponentModel. What is the purpose of that namespace? To control designer behaviour. The documentation also says this:
Quote:
You can create a DefaultValueAttribute with any value. A member's default value is typically its initial value. A visual designer can use the default value to reset the member's value. Code generators can use the default values also to determine whether code should be generated for the member.
What you're talking about is the initial value, not the default value. Basically, the default value is what the property gets set to when you right-click it in the Properties window of the designer and select Reset.
Also, if you want an initial value for a property that is different to the default value for its type, you don't have to set them in the constructor. You can declare a backing field explicitly and initialise that where it's declared. This is actually better because the compiler can optimise such code better.