Skip to content

Instantly share code, notes, and snippets.

@ameerthehacker
Created August 25, 2018 11:09
Show Gist options
  • Save ameerthehacker/2bb407b6097e1c44fde07eb6a1529ff0 to your computer and use it in GitHub Desktop.
Save ameerthehacker/2bb407b6097e1c44fde07eb6a1529ff0 to your computer and use it in GitHub Desktop.
IValidator implementation for required field validation
using XamarinFormValidation.Validators.Contracts;
namespace XamarinFormValidation.Validators.Implementations
{
public class RequiredValidator: IValidator
{
public string Message { get; set; } = "This field is required";
public bool Check(string value)
{
return !string.IsNullOrWhiteSpace(value);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment