Skip to content

Instantly share code, notes, and snippets.

@ameerthehacker
Last active August 25, 2018 19:01
Show Gist options
  • Save ameerthehacker/111f427c9e2205cc69fb75a0d808a287 to your computer and use it in GitHub Desktop.
Save ameerthehacker/111f427c9e2205cc69fb75a0d808a287 to your computer and use it in GitHub Desktop.
...
namespace XamarinFormValidation.Behaviors
{
public class ValidationGroupBehavior: Behavior<View>
{
...
public void Update()
{
bool isValid = true;
foreach (ValidationBehavior validationItem in _validationBehaviors)
{
isValid = isValid && validationItem.Validate();
}
IsValid = isValid;
}
public bool IsValid
{
get
{
return (bool)GetValue(IsValidProperty);
}
set
{
SetValue(IsValidProperty, value);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment