I currently already decorate properties in my business objects with attributes related to validation in Windows Forms.
I would like to add attributes that would determine how the data is formatted. This would hopefully work seamlessly with data binding.
Is there a way to do this?
Formatting is achieved (in winforms) via two primary approaches:
ToString()TypeConvertersubclass, and use[TypeConverter(...)]on your custom type (or properties of a class, etc), to apply your formatting (when the target type istypeof(string))For example: