We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to use ListView events using Prism Framework in Xamarin.Forms (SfListView)

Platform: Xamarin.Forms |
Control: SfListView

You can use SwipeEnded event in Prism Framework using Behavior in Xamarin.Forms SfListView.


Defined left and right swipe template.

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
            <syncfusion:SfListView x:Name="listView" ItemSize="60" ItemsSource="{Binding ContactsInfo}" AllowSwiping="True" SwipeOffset="120">
                <syncfusion:SfListView.ItemTemplate >
                        <Grid x:Name="grid">
                                <ColumnDefinition Width="70" />
                                <ColumnDefinition Width="*" />
                            <Image Source="{Binding ContactImage}" VerticalOptions="Center" HorizontalOptions="Center" HeightRequest="50" WidthRequest="50"/>
                            <Grid Grid.Column="1" RowSpacing="1" Padding="10,0,0,0" VerticalOptions="Center">
                                <Label LineBreakMode="NoWrap" TextColor="#474747" Text="{Binding ContactName}"/>
                                <Label Grid.Row="1" Grid.Column="0" TextColor="#474747" LineBreakMode="NoWrap" Text="{Binding ContactNumber}"/>
                        <Grid BackgroundColor="SlateBlue">
                            <Label Text="Left swipe view" HorizontalOptions="Center" VerticalOptions="Center"/>
                        <Grid BackgroundColor="SlateBlue">
                            <Label Text="Right swipe view" HorizontalOptions="Center" VerticalOptions="Center"/>


Trigger SwipeEnded event for ListView and reset the swipe based on SwipeOffset value using the ResetSwipe method in the Behavior class.

namespace ListViewXamarin
    public class Behavior : Behavior<ContentPage>
        SfListView ListView;
        protected override void OnAttachedTo(ContentPage bindable)
            ListView = bindable.FindByName<SfListView>("listView");
            ListView.SwipeEnded += ListView_SwipeEnded;
        private void ListView_SwipeEnded(object sender, SwipeEndedEventArgs e)
            if (e.SwipeOffset > 100)

View sample in GitHub

2X faster development

The ultimate Xamarin UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile