At what offset does swiping trigger invoked event?

159 views Asked by At

Using Xamarin Forms, I'm trying to understand at which offset during swiping will my SwipeView trigger the Invoked event when using mode Execute and if it's possible to programmatically get this value. So far what I've seen is it seems to be around 60% of Threshold (at least for Android) but I'm curious to know if this value is available somewhere in the component. I originally thought it wouldn't be triggered until it hit Threshold but I found that it fires before it meets that value. Below is my XAML:

<SwipeView
    SwipeChanging="SwipeView_SwipeChanging"
    SwipeEnded="SwipeView_SwipeEnded"
    SwipeStarted="SwipeView_SwipeStarted"
    Threshold="80">
    <SwipeView.TopItems>
        <SwipeItems Mode="Execute" SwipeBehaviorOnInvoked="Close">
            <SwipeItemView BackgroundColor="Transparent" Invoked="SwipeItemView_Invoked">
                <Label Text="Create New Task" />
            </SwipeItemView>
        </SwipeItems>
    </SwipeView.TopItems>
    <SwipeView.Content>
    ...
    </SwipeView.Content>
</SwipeView>

With the above example with Threshold at 80 it seems to trigger around 49/50.

0

There are 0 answers