Forum Xamarin.Forms

How to validate multiple controls on a form before allowing user to leave a content page?

DaveBoggustDaveBoggust USMember, University ✭✭

I have used behaviors and triggers to validate individual controls and highlight text in red if invalid, for example. However what is the best approach to validate multiple controls and prevent the user from leaving the page until the invalid entires/settings are corrected? I know that behaviors can be bindable and was wondering if somehow this is the way to go but I'm not sure how to combine them to create an overall validation state. Any advice or sample code that people can provide or direct me to for reference would be greatly appreciated. Thanks.

Best Answer


  • DaveBoggustDaveBoggust USMember, University ✭✭

    OK, thanks @AdamP , I'll look into that further.

  • markmunizmarkmuniz USUniversity ✭✭

    @DaveBoggust , how did you end up validating the page from your viewmodel?

Sign In or Register to comment.