I have a screen with a business rules that displays some fields based on a business data and does not display others. i then play with Visibility to show/hide them.
My business object implements IDataErrorInfo.
The problem i have is that some of the validation pertains only when the field is shown.
In this code extract, the first IF makes the validation only if type_account is INTERNAL
string ValidateMinimumAmount()
{
if (this.type_account != "INTERNAL")
return null;
if (this.account_minimum==null)
{
return "You must provide a minimum amount";
}
return null;
}
the problem i have is that since the initial state of my BO is NOT "Internal" then EVEN if after the user selects "INTERNAL" the validation never occurs again.
How can i "force" the validation to occur AFTER the first time. Of course i have checked that if the initial state is "Internal" then it works