I
ID GO
Guest
Unable to pass Parameter Value in CustomValidation Attribute
public string Test { get; set; } = "ValidateSpecialCharacters";
[CustomValidation(typeof(ValidationTextBox), Test)]
public string GeneralDescription
{
get => _generalDescription;
set
{
SetValue(ref _generalDescription, value);
TestBorderBrush = ValidationDictionaryCollection["GeneralDescription"] != string.Empty
? new SolidColorBrush(Color.FromArgb(0xff, 0xff, 0x00, 0x00))
: new SolidColorBrush(Color.FromArgb(102, 0, 0, 0));
}
}
public static ValidationResult ValidateSpecialCharacters(string zip)
{
var regexItem = new Regex("^[a-zA-Z0-9 ]*$");
return regexItem.IsMatch(zip)
? ValidationResult.Success
: new ValidationResult("Cannot have Special characters");
}
I dont want Property to be Constant
Continue reading...
public string Test { get; set; } = "ValidateSpecialCharacters";
[CustomValidation(typeof(ValidationTextBox), Test)]
public string GeneralDescription
{
get => _generalDescription;
set
{
SetValue(ref _generalDescription, value);
TestBorderBrush = ValidationDictionaryCollection["GeneralDescription"] != string.Empty
? new SolidColorBrush(Color.FromArgb(0xff, 0xff, 0x00, 0x00))
: new SolidColorBrush(Color.FromArgb(102, 0, 0, 0));
}
}
public static ValidationResult ValidateSpecialCharacters(string zip)
{
var regexItem = new Regex("^[a-zA-Z0-9 ]*$");
return regexItem.IsMatch(zip)
? ValidationResult.Success
: new ValidationResult("Cannot have Special characters");
}
I dont want Property to be Constant
Continue reading...