Skip to content

Instantly share code, notes, and snippets.

@ameerthehacker
Last active August 25, 2018 15:50
Show Gist options
  • Save ameerthehacker/75cd4fd377e2aa92fe1349f7fb463188 to your computer and use it in GitHub Desktop.
Save ameerthehacker/75cd4fd377e2aa92fe1349f7fb463188 to your computer and use it in GitHub Desktop.
Xamarin Behavior for validating an element
using Xamarin.Forms;
using System.Collections.ObjectModel;
using XamarinFormValidation.Validators.Contracts;
using XamarinFormValidation.Validators.Implementations;
using System.ComponentModel;
namespace XamarinFormValidation.Behaviors
{
public class ValidationBehavior : Behavior<View>
{
IErrorStyle _style = new BasicErrorStyle();
View _view;
public string PropertyName { get; set; }
public ObservableCollection<IValidator> Validators { get; set; } = new ObservableCollection<IValidator>();
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment