SilverLight 3 DataForms - How to handle EditableObject and other declartive attributes

Posts   
 
    
cmprogrock
User
Posts: 40
Joined: 16-Nov-2008
# Posted on: 30-Mar-2009 17:47:09   

I want to start using Silverlight 3 - Dataforms. See below:

http://pendsevikram.blogspot.com/2009/03/silverlight-3-dataform-control-features.html

Dataforms can use several Declarative attributes on properties at the Class level.

Example:

[Bindable(true, BindingDirection.TwoWay)]

[Display(Name = "First Name :", Description = "Enter Your First Name")]

[Required(ErrorMessage = "Field Cannot be left Blank")]

QUESTION: HOW CAN I BEST ADD THESE ATTRIBUTES SO THAT THEY ARE NOT OVERWRITTEN ON REGEN? (CAN I PLACE THESE IN A PARTIAL CLASE FILE? ETC)

Thanks

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 31-Mar-2009 11:10:53   

Partial classes will not get overwritten when re-generation.

But I believe you should use projection to DTOs. (Custom Classes to hold the attributes). DTOs are lightweight classes that are more suitable for Silverlight.