AndreiMisiukevich / CardView

CardsView | CarouselView | CoverflowView | CubeView for Xamarin.Forms
MIT License
710 stars 114 forks source link

How can I validate and prevent swiping? #395

Closed developer9969 closed 3 years ago

developer9969 commented 3 years ago

Hi love your controls, and I hope that you will port it to MAUI once available.

I am using the CaroselView that has 7 Views and each view has different data input.

Validation How can I prevent the user from swiping to the next view/page unless all the data has been validated. I looked at the ItemSwipedCommand but that seems to happen to late in the lifecyle..

IsVerticalSwipeEnabled I set it to true and I was expecting to swipe from the bottom up was moving to the next page? Am I mis-interpreting what this flag means?

Really appreciate your time and input thanks

AndreiMisiukevich commented 3 years ago

Hi @developer9969 yes, swipe in this context means "Swipe gesture" not changing cards.

  1. If you want to prevent users from swiping until the form is completed, then set IsUserInteractionEnabled=false on ItemAppeared event. Or IsNextItemPanInteractionEnabled = false.

  2. If you want to get a vertical carousel instead of horizontal, then set IsHorizontalOrientation = false

developer9969 commented 3 years ago

Hi @AndreiMisiukevich thank you so much for your time!! Everything you suggested works

thank you