I found the solution.
When WCF RIA services generates the code, attribute's validation is performed automatically, because the code for validation is implemented in the base Entity class.
If we create a partial class on the client with attributes, we have to force the system in the property setter to validate. For that purpose we have to use the Validator class static ValidateAttribute method:
Code:
[Required]
[Display (Name="ConfirmPassword")]
[CustomValidation(typeof(UserInformationValidation), "ValidateConfirmPassword")]
public string confirm_password
{
get
{
return confPswd;
}
set
{
ValidationContext context = new ValidationContext(this, null, null);
context.MemberName = "confirm_password";
Validator.ValidateProperty(value, context);
confPswd = value;
OnPropertyChanged(new PropertyChangedEventArgs("confirm_password"));
}
}
(Variable string confPswd declared at the class level)
Now the confirm_password validation works as any other attributes set on the server.
Thanks for read this
Gabor