Forum Xamarin.Forms

Validation in Xamarin Forms (view in Android).

Hello Experts :).

This time I have very short question. Is it possible to write code in Xamarin.Forms, such that it will make use of EditText.SetError, while showing error on Android?

I tried custom renderers and actually I was not so happy with them, because I could not pass regular expressions or other parameters to them.

Thank you for any answers.

Answers

  • RendyDelRosarioRendyDelRosario DOUniversity ✭✭✭
    edited April 2017
  • mozartosmozartos SEMember

    Thank you.
    However I tried Behaviors, but I see some problems with that.

    First, I can't pass regular expression pattern to them. In my application there are ~20 fields. Unfortunately, 15 of them need to have regular expression pattern. For implementation I have to do 15 behaviors - seems strange, but actually it is doable. Second thing, since the previous version application was written in Android, I have to somehow investigate, how to use EditText.SetError(). Business Owner doesn't want to change the application view.

    It would be very sad, if I had to switch to React Native, because of such a small thing :neutral: .

    Thank you for any other guides / hints.

Sign In or Register to comment.