public override PropertyConstraintViolationError Validate(object value, PropertyDefinition propertyDefinition, IPropertyBag propertyBag) { Uri uri = value as Uri; if (uri != null && !this.IsExpectedScheme(uri.Scheme)) { return(new PropertyConstraintViolationError(DataStrings.ConstraintViolationInvalidUriScheme(uri, this.MakeCommaSeparatedListOfAllowedSchemes()), propertyDefinition, value, this)); } return(null); }