Xamarin Forms Email Validator

Yep, you need to validate an email address on your form. Here’s the easy way to do it.

First, add the NuGet Package “FormsToolKit” from James Montemagno.

Now add a reference to it in the header of your page:

2017-09-07 14_32_46-CoApp - Microsoft Visual Studio  (Administrator).png

Now, tell your Entry that it should use the EmailValidatorBehavour from the FormsToolKit

2017-09-07 14_33_53-CoApp - Microsoft Visual Studio  (Administrator).png

Now, add a label and tell it’s IsVisible to be triggered when the EmailValidator fires:

2017-09-07 14_34_53-CoApp - Microsoft Visual Studio  (Administrator).png

Now the Label will appear when the EmailValidator’s IsValid field is False

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s