Also, if your property is exposing a value type private variable in your
class, then use an initializer to set that variable to the default value. I
have had problems with the DefaultValueAttribute when I did not correctly
initialize the underlying variable. (Don't remember exactly what - I haven't
done that recently )
-Rachel
Relaxin said:
Use the [DefaultValueAttribute] or use the ShouldSerialize<propertyname>
and Reset<propertyname>.
Job Lot said:
how can i assign a default value for a custom property?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.