Created
August 25, 2018 11:09
-
-
Save ameerthehacker/2bb407b6097e1c44fde07eb6a1529ff0 to your computer and use it in GitHub Desktop.
IValidator implementation for required field validation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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