menu

Xamarin.Forms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class SfListView - Xamarin.Forms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class SfListView

    SfListView control renders a set of data items with different layouts and orientations. Data can be grouped, sorted, and filtered with ease.

    Inheritance
    System.Object
    SfListView
    Implements
    IPullToRefresh
    System.IDisposable
    IParallaxView
    Namespace: Syncfusion.ListView.XForms
    Assembly: Syncfusion.SfListView.XForms.dll
    Syntax
    public class SfListView : Grid, IPullToRefresh, IDisposable, IParentThemeElement, IThemeElement, IParallaxView
    Examples

    The following example demonstrates how to initialize and use the SfListView in Xamarin.Forms.

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using Syncfusion.ListView.XForms;
    using Xamarin.Forms;
    

    namespace BookInfo {

    class BookInfo {

    public string BookName { get; set; } public string BookAuthor { get; set; }

    public BookInfo(string bookName, string bookAuthor) { BookName = bookName; BookAuthor = bookAuthor; }

    }

    class BookInfoMainPage : ContentPage {

    public BookInfoMainPage() {

    // Define some data. List bookInfo = new List { new BookInfo("Xamarin.Forms", " by Derek Jensen "), new BookInfo("Object-Oriented Programming in C#", "by Sander Rossel"), new BookInfo("iOS Succinctly", "by Ryan Hodson"), new BookInfo("Android Programming", "by Ryan Hodson"), };

    // Initializes the SfListView SfListView listView = new SfListView { // Source of the data ItemsSource = bookInfo,

    // Define the template for displaying each item ItemTemplate = new DataTemplate(() => { // Create a view with bindings for displaying each property. Label bookNameLabel = new Label() { FontSize = 18}; bookNameLabel.SetBinding(Label.TextProperty, "BookName");

    Label bookAuthorLabel = new Label() { FontSize = 12 }; bookAuthorLabel.SetBinding(Label.TextProperty, "BookAuthor");

    // returns a ViewCell. return new ViewCell { View = new StackLayout { Children = { bookNameLabel, bookAuthorLabel } } }; }) };

    this.Content = listView; } } }

    Constructors

    SfListView()

    Initializes a new instance of the SfListView class.

    Declaration
    public SfListView()

    Fields

    AllowGroupExpandCollapseProperty

    Identifies the AllowGroupExpandCollapse bindable property.

    Declaration
    public static readonly BindableProperty AllowGroupExpandCollapseProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    AllowKeyboardNavigationProperty

    Identifies the AllowKeyboardNavigation bindable property.

    Declaration
    public static readonly BindableProperty AllowKeyboardNavigationProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    AllowSwipingProperty

    Identifies the AllowSwiping bindable property.

    Declaration
    public static readonly BindableProperty AllowSwipingProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    AutoFitModeProperty

    Identifies the AutoFitMode bindable property.

    Declaration
    public static readonly BindableProperty AutoFitModeProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    CurrentItemProperty

    Identifies the CurrentItem bindable property.

    Declaration
    public static readonly BindableProperty CurrentItemProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    DataSourceProperty

    Identifies the DataSource bindable property.

    Declaration
    public static readonly BindableProperty DataSourceProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    DragItemTemplateProperty

    Identifies the DragItemTemplate bindable property.

    Declaration
    public static readonly BindableProperty DragItemTemplateProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    DragStartModeProperty

    Identifies the DragStartMode bindable property.

    Declaration
    public static readonly BindableProperty DragStartModeProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    FocusBorderColorProperty

    Identifies the FocusBorderColor bindable property.

    Declaration
    public static readonly BindableProperty FocusBorderColorProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    FocusBorderThicknessProperty

    Identifies the FocusBorderThickness bindable property.

    Declaration
    public static readonly BindableProperty FocusBorderThicknessProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    FooterSizeProperty

    Identifies the FooterSize bindable property.

    Declaration
    public static readonly BindableProperty FooterSizeProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    FooterTemplateProperty

    Identifies the FooterTemplate bindable property.

    Declaration
    public static readonly BindableProperty FooterTemplateProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    GroupHeaderSizeProperty

    Identifies the GroupHeaderSize bindable property.

    Declaration
    public static readonly BindableProperty GroupHeaderSizeProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    GroupHeaderTemplateProperty

    Identifies the GroupHeaderTemplate bindable property.

    Declaration
    public static readonly BindableProperty GroupHeaderTemplateProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    HeaderSizeProperty

    Identifies the HeaderSize bindable property.

    Declaration
    public static readonly BindableProperty HeaderSizeProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    HeaderTemplateProperty

    Identifies the HeaderTemplate bindable property.

    Declaration
    public static readonly BindableProperty HeaderTemplateProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    HoldCommandParameterProperty

    Identifies the HoldCommandParameter bindable property.

    Declaration
    public static readonly BindableProperty HoldCommandParameterProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    HoldCommandProperty

    Identifies the HoldCommand bindable property.

    Declaration
    public static readonly BindableProperty HoldCommandProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    IsBusyProperty

    Identifies the IsBusy bindable property.

    Declaration
    public static readonly BindableProperty IsBusyProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    IsScrollBarVisibleProperty

    Identifies the IsScrollBarVisible bindable property.

    Declaration
    public static readonly BindableProperty IsScrollBarVisibleProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    IsScrollingEnabledProperty

    Identifies the IsScrollingEnabled bindable property.

    Declaration
    public static readonly BindableProperty IsScrollingEnabledProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    IsStickyFooterProperty

    Identifies the IsStickyFooter bindable property.

    Declaration
    public static readonly BindableProperty IsStickyFooterProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    IsStickyGroupHeaderProperty

    Identifies the IsStickyGroupHeader bindable property.

    Declaration
    public static readonly BindableProperty IsStickyGroupHeaderProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    IsStickyHeaderProperty

    Identifies the IsStickyHeader bindable property.

    Declaration
    public static readonly BindableProperty IsStickyHeaderProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    ItemSizeProperty

    Identifies the ItemSize bindable property.

    Declaration
    public static readonly BindableProperty ItemSizeProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    ItemSpacingProperty

    Identifies the ItemSpacing bindable property.

    Declaration
    public static readonly BindableProperty ItemSpacingProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    ItemsSourceChangeCachingStrategyProperty

    Identifies the ItemsSourceChangeCachingStrategy bindable property.

    Declaration
    public static readonly BindableProperty ItemsSourceChangeCachingStrategyProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    ItemsSourceProperty

    Identifies the ItemsSource bindable property.

    Declaration
    public static readonly BindableProperty ItemsSourceProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    ItemTemplateProperty

    Identifies the ItemTemplate bindable property.

    Declaration
    public static readonly BindableProperty ItemTemplateProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    LayoutManagerProperty

    Identifies the LayoutManager bindable property.

    Declaration
    public static readonly BindableProperty LayoutManagerProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    LeftSwipeTemplateProperty

    Identifies the LeftSwipeTemplate bindable property.

    Declaration
    public static readonly BindableProperty LeftSwipeTemplateProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    ListViewCachingStrategyProperty

    Identifies the ListViewCachingStrategy bindable property.

    Declaration
    public static readonly BindableProperty ListViewCachingStrategyProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    LoadMoreCommandParameterProperty

    Identifies the LoadMoreCommandParameter bindable property.

    Declaration
    public static readonly BindableProperty LoadMoreCommandParameterProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    LoadMoreCommandProperty

    Identifies the LoadMoreCommand bindable property.

    Declaration
    public static readonly BindableProperty LoadMoreCommandProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    LoadMoreOptionProperty

    Identifies LoadMoreOption bindable property.

    Declaration
    public static readonly BindableProperty LoadMoreOptionProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    LoadMorePositionProperty

    Identifies LoadMorePosition bindable property.

    Declaration
    public static readonly BindableProperty LoadMorePositionProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    LoadMoreTemplateProperty

    Identifies the LoadMoreTemplate bindable property.

    Declaration
    public static readonly BindableProperty LoadMoreTemplateProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    OrientationProperty

    Identifies the Orientation bindable property.

    Declaration
    public static readonly BindableProperty OrientationProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    RightSwipeTemplateProperty

    Identifies the RightSwipeTemplate bindable property.

    Declaration
    public static readonly BindableProperty RightSwipeTemplateProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    SelectedItemProperty

    Identifies the SelectedItem bindable property.

    Declaration
    public static readonly BindableProperty SelectedItemProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    SelectedItemsProperty

    Identifies the SelectedItems bindable property.

    Declaration
    public static readonly BindableProperty SelectedItemsProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    SelectedItemTemplateProperty

    Identifies the SelectedItemTemplate bindable property.

    Declaration
    public static readonly BindableProperty SelectedItemTemplateProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    SelectionBackgroundColorProperty

    Identifies the SelectionBackgroundColor bindable property.

    Declaration
    public static readonly BindableProperty SelectionBackgroundColorProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    SelectionChangedCommandParameterProperty

    Identifies the SelectionChangedCommandParameter bindable property.

    Declaration
    public static readonly BindableProperty SelectionChangedCommandParameterProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    SelectionChangedCommandProperty

    Identifies the SelectionChangedCommand bindable property.

    Declaration
    public static readonly BindableProperty SelectionChangedCommandProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    SelectionGestureProperty

    Identifies the SelectionGesture bindable property.

    Declaration
    public static readonly BindableProperty SelectionGestureProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    SelectionModeProperty

    Identifies the SelectionMode bindable property.

    Declaration
    public static readonly BindableProperty SelectionModeProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    StickyFooterPositionProperty

    Identifies the StickyFooterPosition bindabe property.

    Declaration
    public static readonly BindableProperty StickyFooterPositionProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    SwipeOffsetProperty

    Identifies the SwipeOffset bindable property.

    Declaration
    public static readonly BindableProperty SwipeOffsetProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    SwipeThresholdProperty

    Identifies the SwipeThreshold bindable property.

    Declaration
    public static readonly BindableProperty SwipeThresholdProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    TapCommandParameterProperty

    Identifies the TapCommandParameter bindable property.

    Declaration
    public static readonly BindableProperty TapCommandParameterProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    TapCommandProperty

    Identifies the TapCommand bindable property.

    Declaration
    public static readonly BindableProperty TapCommandProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    This bindable property is read-only.

    Properties

    AllowGroupExpandCollapse

    Gets or sets a value indicating whether to allow expanding and collapsing of groups for GroupHeaderItem.

    Declaration
    public bool AllowGroupExpandCollapse { get; set; }
    Property Value
    Type Description
    System.Boolean

    true If allow expand and collapse groups; otherwise, false.

    Examples
    SfListView listView = new SfListView();
    listView.AllowGroupExpandCollapse = true;

    AllowKeyboardNavigation

    Gets or sets a value indicating whether to allow navigating through keyboard buttons.

    Declaration
    public bool AllowKeyboardNavigation { get; set; }
    Property Value
    Type Description
    System.Boolean

    true If allows keyboard navigation; otherwise, false.

    Examples
    SfListView listView = new SfListView();
    listView.AllowKeyboardNavigation = true;

    AllowSwiping

    Gets or sets a value indicating whether to enable swiping or not.

    Declaration
    public bool AllowSwiping { get; set; }
    Property Value
    Type
    System.Boolean
    Examples
    SfListView listView = new SfListView();
    listView.AllowSwiping = true;
    listView.SwipeOffset = 60;
    listView.SwipeThreshold = 30;

    AutoFitMode

    Gets or sets the value that indicates whether SfListView will AutoFitMode the items based on its content.

    Declaration
    public AutoFitMode AutoFitMode { get; set; }
    Property Value
    Type
    AutoFitMode
    Examples
    SfListView listView = new SfListView();
    listView.AutoFitMode = AutoFitMode.Height;

    AutoScroller

    Gets the value indicating the instance of AutoScroller.

    Declaration
    public AutoScroller AutoScroller { get; }
    Property Value
    Type
    AutoScroller
    Examples
    SfListView listView = new SfListView();
    listView.DragStartMode = DragStartMode.OnHold;
    this.listView.AutoScroller.Interval = new TimeSpan(0, 0, 0, 0, 200);

    CanCustomizeContentLayout

    Gets or sets a value indicating whether to bounce SfListView body region only with TransitionMode-Push.

    Declaration
    public bool CanCustomizeContentLayout { get; set; }
    Property Value
    Type
    System.Boolean
    Examples
    SfListView listView = new SfListView();
    listView.CanCustomizeContentLayout = true;

    CurrentItem

    Gets or sets the current selected item.

    Declaration
    public object CurrentItem { get; set; }
    Property Value
    Type Description
    System.Object

    The current item.

    Examples
    SfListView listView = new SfListView();
    ViewModel viewModel = new ViewModel();
    listView.ItemsSource = viewModel.BookInfo;
    listView.CurrentItem = viewModel.BookInfo[2];

    DataSource

    Gets or sets the DataSource for data operations like sorting, filtering, and grouping.

    Declaration
    public DataSource DataSource { get; set; }
    Property Value
    Type
    DataSource
    Examples
    SfListView listView = new SfListView();
    ViewModel viewModel = new ViewModel();
    DataSource dataSource = new DataSource();
    dataSource.SortDescriptors.Add(new SortDescriptor()
    {
      PropertyName = "ContactName",
      Direction = ListSortDirection.Ascending,
    }); 
    dataSource.Source = viewModel.BookInfo;
    listView.DataSource = dataSource;

    DragDropController

    Gets or sets the DragDropController which controls drag-and-drop and related operations.

    Declaration
    public DragDropController DragDropController { get; set; }
    Property Value
    Type Description
    DragDropController

    An instance of DragDropController.

    Examples
    SfListView listView = new SfListView();
    listView.DragStartMode = DragStartMode.OnHold;
    this.listView.DragDropController = new DragDropControllerExt(this.listView);
    
    public class DragDropControllerExt : DragDropController
    {
       public DragDropControllerExt(SfListView listView) : base(listView)
       {
    
       }
       protected override bool CanAdjustDragItemAxis()
       {
            return true;
        }
    
       protected override Task<bool> OnLayoutItem(View element, Rectangle rect)
       {
           return element.LayoutTo(rect, 250, Easing.BounceIn);
       }
    }

    DragItemTemplate

    Gets or sets the template that is used to display when dragging the item.

    Declaration
    public DataTemplate DragItemTemplate { get; set; }
    Property Value
    Type
    Xamarin.Forms.DataTemplate
    Examples
    SfListView listView = new SfListView();
    listView.DragStartMode = DragStartMode.OnHold;
    listView.DragItemTemplate = new DataTemplate(() => 
    {
        var grid = new Grid();
        var name = new Label { FontSize = 15 };
        name.SetBinding(Label.TextProperty, new Binding("Name"));
        grid.Children.Add(name);
        return grid;
    });

    DragStartMode

    Gets or sets a value indicating whether to allow reordering the ListViewItem by drag and drop.

    Declaration
    public DragStartMode DragStartMode { get; set; }
    Property Value
    Type
    DragStartMode
    Examples
    SfListView listView = new SfListView();
    listView.DragStartMode = DragStartMode.OnHold;

    FocusBorderColor

    Gets or sets the border color for the current focused item.

    Declaration
    public Color FocusBorderColor { get; set; }
    Property Value
    Type
    Xamarin.Forms.Color
    Remarks

    For Android and iOS platform, the default color is Xamarin.Forms.Color.Transparent and for macOS and UWP platform, the default color is Xamarin.Forms.Color.Blue.

    Examples
    SfListView listView = new SfListView();
    listView.FocusBorderColor = new Color.Blue;

    FocusBorderThickness

    Gets or sets the border thickness for the current focused item.

    Declaration
    public Thickness FocusBorderThickness { get; set; }
    Property Value
    Type
    Xamarin.Forms.Thickness
    Remarks

    For Android and iOS platform, the default thickness is 0 and for macOS and UWP platform, the default thickness is 1.

    Examples
    SfListView listView = new SfListView();
    listView.FocusBorderColor = new Color.Blue;
    listView.FocusBorderThickness = new Thickness(0, 5, 5, 0);

    FooterSize

    Gets or sets the height (for vertical orientation) or width (for horizontal orientation) of the footer. The default value is 40d.

    Declaration
    public double FooterSize { get; set; }
    Property Value
    Type
    System.Double
    Examples
    SfListView listView = new SfListView();
    listView.FooterSize = 70;

    FooterTemplate

    Gets or sets the footer template for SfListView.

    Declaration
    public DataTemplate FooterTemplate { get; set; }
    Property Value
    Type
    Xamarin.Forms.DataTemplate
    Examples
    ViewModel viewModel = new ViewModel();
    SfListView listView = new SfListView();
    listView.ItemsSource = viewModel.InboxInfo;
    listView.FooterTemplate = new DataTemplate(() =>
    {
       var grid = new Grid();
       grid.BackgroundColor = Color.FromHex("#4CA1FE");
       var footerLabel = new Label
       {
           BackgroundColor = Color.White,
           FontSize = 18,
           FontAttributes = FontAttributes.Bold,
           Text = "Footer"
       };
    
       grid.Children.Add(footerLabel);
    
       return grid;
    });

    GroupHeaderSize

    Gets or sets the height (for vertical orientation) or width (for horizontal orientation) of the group header. The default value is 40d.

    Declaration
    public double GroupHeaderSize { get; set; }
    Property Value
    Type
    System.Double
    Examples
    SfListView listView = new SfListView();
    listView.GroupHeaderSize = 70;

    GroupHeaderTemplate

    Gets or sets the Xamarin.Forms.DataTemplate for the group headers of SfListView.

    Declaration
    public DataTemplate GroupHeaderTemplate { get; set; }
    Property Value
    Type
    Xamarin.Forms.DataTemplate
    Examples
    SfListView listView = new SfListView();
    listView.GroupHeaderTemplate = new DataTemplate(() =>
    {
       var grid = new Grid();
    
       var label1 = new Label();
       label1.SetBinding(Label.TextProperty, new Binding("Key"));
    
       var label2 = new Label();
       Binding binding = new Binding("Items");
       binding.Converter = new Converter();
       label2.SetBinding(Label.TextProperty, binding);
    
       grid.Children.Add(label1);
       grid.Children.Add(label2, 1, 0);
    
       return grid;
    });

    HeaderSize

    Gets or sets the height (for vertical orientation) or width (for horizontal orientation) of the header. The default value is 40d.

    Declaration
    public double HeaderSize { get; set; }
    Property Value
    Type
    System.Double
    Examples
    SfListView listView = new SfListView();
    listView.HeaderSize = 70;

    HeaderTemplate

    Gets or sets a header template for SfListView.

    Declaration
    public DataTemplate HeaderTemplate { get; set; }
    Property Value
    Type
    Xamarin.Forms.DataTemplate
    Examples
    ViewModel viewModel = new ViewModel();
    SfListView listView = new SfListView();
    listView.ItemsSource = viewModel.InboxInfo;
    listView.HeaderTemplate = new DataTemplate(() =>
    {
       var grid = new Grid();
       grid.BackgroundColor = Color.FromHex("#4CA1FE");
       var headerLabel = new Label
       {
           BackgroundColor = Color.White,
           FontSize = 18,
           FontAttributes = FontAttributes.Bold,
           Text = "Inbox"
       };
    
       grid.Children.Add(headerLabel);
    
       return grid;
    });

    HoldCommand

    Gets or sets System.Windows.Input.ICommand which will be executed when hold on the ListViewItem.

    Declaration
    public ICommand HoldCommand { get; set; }
    Property Value
    Type
    System.Windows.Input.ICommand
    Examples
    SfListView listView = new SfListView();
    ViewModel viewModel = new ViewModel();
    listView.HoldCommand = viewModel.HoldCommand;
    public class CommandViewModel
    {
      private Command<Object> holdingCommand;
    
      public Command<object> HoldingCommand
      {
          get { return holdingCommand; }
          set { holdingCommand = value; }
      }
    
      public CommandViewModel()
      {
          HoldingCommand = new Command<object>(HoldingCommandMethod);
      }
    
      private void HoldingCommandMethod(object obj)
      {
          if ((obj as Syncfusion.ListView.XForms.ItemHoldingEventArgs).ItemData == viewModel.InboxInfo[3])
              viewModel.InboxInfo.Remove((obj as Syncfusion.ListView.XForms.ItemHoldingEventArgs).ItemData as ListViewInboxInfo);
      }
    }

    HoldCommandParameter

    Gets or sets the parameter for HoldCommand.

    Declaration
    public object HoldCommandParameter { get; set; }
    Property Value
    Type
    System.Object
    Remarks

    The default value is ItemHoldingEventArgs.

    IsBusy

    Gets or sets a value indicating whether list view is busy in loading more items. If it is true, the load more indicator will be displayed until it sets to false.

    Declaration
    public bool IsBusy { get; set; }
    Property Value
    Type
    System.Boolean
    Examples
    SfListView listView = new SfListView();
    ViewModel viewModel = new ViewModel();
    listView.ItemsSource = viewModel.Products;
    listView.LoadMoreOption = LoadMoreOption.Manual;
    listView.LoadMoreCommand = viewModel.LoadMoreItemsCommand;
    listView.SetBinding(SfListView.IsBusyProperty, new Binding("IsBusy"));
    
    //ViewModel.cs
    private bool isBusy;
    public bool IsBusy
    {
        get { return isBusy; }
        set
        {
            this.isBusy = value;
            RaisePropertyChanged("IsBusy");
        }
    }
    
    LoadMoreItemsCommand = new Command<object>(LoadMoreItems, CanLoadMoreItems);
    
    private bool CanLoadMoreItems(object obj)
    {
        if (Products.Count >= totalItems)
            return false;
        return true;
    }
    
    private async void LoadMoreItems(object obj)
    {
        var listView = obj as Syncfusion.ListView.XForms.SfListView;
        IsBusy = true;
        await Task.Delay(2500);
        var index = Products.Count;
        var count = index + 3 >= totalItems ? totalItems - index : 3;
        AddProducts(index, count);
        IsBusy = false;
    }
    
    private void AddProducts(int index, int count)
    {
       var name = Names[0];
       var p = new Product()
       {
           Name = name,
           Weight = Weights[0],
           Price = Prices[0],
           Image = ImageSource.FromResource("LoadMoreUG.LoadMore." + name.Replace(" ", string.Empty) + ".jpg")
       };
    
       Products.Add(p);
    }

    IsScrollBarVisible

    Gets or sets a value indicating whether to display the scrollbar or not.

    Declaration
    public bool IsScrollBarVisible { get; set; }
    Property Value
    Type
    System.Boolean
    Remarks

    ScrollBar cannot be updated at runtime.

    Examples
    SfListView listView = new SfListView();
    listView.IsScrollBarVisible = false;

    IsScrollingEnabled

    Gets or sets a value indicating whether the scroling is enable or disabled for listview.

    Declaration
    public bool IsScrollingEnabled { get; set; }
    Property Value
    Type
    System.Boolean
    Remarks

    if IsScrollingEnabled is false then ListView will be rendering all its content with full height. Therefore, listView content will not be viewable without external ScrollView if they have content to be loaded that exceeds view size. if IsScrollingEnabled is true then ListView will make its content appropriate to View Size and reuse the items during the scrolling process.

    IsStickyFooter

    Gets or sets a value indicating whether to display the sticky footer or scrollable footer.

    Declaration
    public bool IsStickyFooter { get; set; }
    Property Value
    Type
    System.Boolean
    Examples
    SfListView listView = new SfListView();
    listView.IsStickyFooter = true;

    IsStickyGroupHeader

    Gets or sets a value indicating whether to display the sticky group header or scrollable group header.

    Declaration
    public bool IsStickyGroupHeader { get; set; }
    Property Value
    Type
    System.Boolean
    Remarks

    If true and AutoFitMode is 'Height' or 'DynamicHeight', sticky group header panning experience will not be smooth or item's layout won't work as expected. You can enable smooth experience, Set same size for all group header items by handling the QueryItemSize event.

    Examples
    SfListView listView = new SfListView();
    listView.IsStickyGroupHeader = true;

    IsStickyHeader

    Gets or sets a value indicating whether to display the sticky header or scrollable header.

    Declaration
    public bool IsStickyHeader { get; set; }
    Property Value
    Type
    System.Boolean
    Examples
    SfListView listView = new SfListView();
    listView.IsStickyHeader = true;

    ItemGenerator

    Gets or sets the ItemGenerator to create or update a ListViewItem.

    Declaration
    public ItemGenerator ItemGenerator { get; set; }
    Property Value
    Type
    ItemGenerator
    Examples
    SfListView listView = new SfListView();
    listView.ItemGenerator = new ItemGeneratorExt(this.listView);
    
    public class ItemGeneratorExt : ItemGenerator
    {
        public SfListView listView;
    
        public ItemGeneratorExt(SfListView listView) : base(listView)
        {
            this.listView = listView;
        }
    
        protected override ListViewItem OnCreateListViewItem(int itemIndex, ItemType type, object data = null)
        {
            if (type == ItemType.Header)
                return new HeaderItemExt(this.listView);
            return base.OnCreateListViewItem(itemIndex, type, data);
        }
    }
    
    public class HeaderItemExt : HeaderItem
    {
       private SfListView listView;
    
       public HeaderItemExt(SfListView listView)
       {
           this.listView = listView
       }
    
       protected override void OnItemAppearing()
       {
           base.OnItemAppearing();
           this.BackgroundColor = Color.Yellow;
       }
    }

    ItemSize

    Gets or sets the height (for vertical orientation) or width (for horizontal orientation) of the item. The default value is 40d.

    Declaration
    public double ItemSize { get; set; }
    Property Value
    Type
    System.Double
    Examples
    SfListView listView = new SfListView();
    listView.ItemSize = 70;

    ItemSpacing

    Gets or sets the item spacing between the items.

    Declaration
    public Thickness ItemSpacing { get; set; }
    Property Value
    Type
    Xamarin.Forms.Thickness
    Examples
    SfListView listView = new SfListView();
    listView.ItemSpacing = new Thickness(0, 5, 5, 0);

    ItemsSource

    Gets or sets the source items to template and display in SfListView.

    Declaration
    public object ItemsSource { get; set; }
    Property Value
    Type
    System.Object
    Examples
    ViewModel viewModel = new ViewModel();
    SfListView listView = new SfListView();
    listView.ItemsSource = viewModel.BookInfo;

    ItemsSourceChangeCachingStrategy

    Gets or sets the caching strategies of data templates when re-using listview items.

    Declaration
    public ItemsSourceChangeCachingStrategy ItemsSourceChangeCachingStrategy { get; set; }
    Property Value
    Type Description
    ItemsSourceChangeCachingStrategy

    The default value is RecycleItems where binding contexts of data template object get updated and re-used changing ItemsSource at runtime. The data templates objects that are selected by a Xamarin.Forms.DataTemplateSelector are cached by the data template type and re-used.

    ItemTemplate

    Gets or sets the data template for ListViewItem.

    Declaration
    public DataTemplate ItemTemplate { get; set; }
    Property Value
    Type
    Xamarin.Forms.DataTemplate
    Examples
    ViewModel viewModel = new ViewModel();
    SfListView listView = new SfListView
    {
       ItemsSource = viewModel.bookInfo,
    

    // Define the template for displaying each item ItemTemplate = new DataTemplate(() => { // Create a view with bindings for displaying each property. Label bookNameLabel = new Label() { FontSize = 18}; bookNameLabel.SetBinding(Label.TextProperty, "BookName");

    Label bookAuthorLabel = new Label() { FontSize = 12 }; bookAuthorLabel.SetBinding(Label.TextProperty, "BookAuthor");

    // returns a ViewCell. return new ViewCell { View = new StackLayout { Children = { bookNameLabel, bookAuthorLabel } } }; }) };

    LayoutManager

    Gets or sets the layout definition for SfListView. The default layout is LinearLayout.

    Declaration
    public LayoutBase LayoutManager { get; set; }
    Property Value
    Type
    LayoutBase
    Remarks

    The LinearLayout will arrange the items in a single column and the GridLayout will arrange the items in a predefined number of columns.

    Examples
    SfListView listView = new SfListView();
    listView.LayoutManager = new GridLayout();

    LeftSwipeTemplate

    Gets or sets the template that is used to display when SwipeDirection is Left and Bottom.

    Declaration
    public DataTemplate LeftSwipeTemplate { get; set; }
    Property Value
    Type
    Xamarin.Forms.DataTemplate
    Examples
    SfListView listView = new SfListView();
    listView.AllowSwiping = true;
    listView.SwipeOffset = 60;
    listView.SwipeThreshold = 30;
    listView.LeftSwipeTemplate = new DataTemplate(() =>
    {
       var grid = new Grid();
    
       var grid1 = new Grid()
       {
           BackgroundColor = Color.FromHex("#009EDA"),
           HorizontalOptions = LayoutOptions.Fill,
           VerticalOptions = LayoutOptions.Fill
       };
       var favoriteGrid = new Grid() { HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center };
       var favoriteImage = new Image() { BackgroundColor = Color.Transparent, HeightRequest = 35, WidthRequest = 35 };
       favoriteImage.Source = ImageSource.FromResource("Swiping.Images.Favorites.png");
       favoriteGrid.Children.Add(favoriteImage);
       grid1.Children.Add(favoriteGrid);
    
       grid.Children.Add(grid1);
    
       return grid;
    
    });

    ListViewCachingStrategy

    Gets or sets the caching strategies of data template when re-using listview items.

    Declaration
    public ListViewCachingStrategy ListViewCachingStrategy { get; set; }
    Property Value
    Type Description
    ListViewCachingStrategy

    The default value is RecycleTemplatewhere that data templates get re-used while data object associated with listview item gets changed. While scrolling binding contexts of data template object get updated and re-used. The data templates objects that are selected by a Xamarin.Forms.DataTemplateSelector are cached by the data template type and re-used.

    LoadMoreCommand

    Gets or sets System.Windows.Input.ICommand which will be executed when load more operation is triggered.

    Declaration
    public ICommand LoadMoreCommand { get; set; }
    Property Value
    Type
    System.Windows.Input.ICommand
    Examples
    ViewModel viewModel = new ViewModel();
    SfListView listView = new SfListView();
    listView.ItemsSource = viewModel.Products;
    listView.LoadMoreOption = LoadMoreOption.Manual;
    listView.LoadMoreCommand = viewModel.LoadMoreItemsCommand;
    listView.SetBinding(SfListView.IsBusyProperty, new Binding("IsBusy"));
    
    //ViewModel.cs
    private bool isBusy;
    public bool IsBusy
    {
        get { return isBusy; }
        set
        {
            this.isBusy = value;
            RaisePropertyChanged("IsBusy");
        }
    }
    
    LoadMoreItemsCommand = new Command<object>(LoadMoreItems, CanLoadMoreItems);
    
    private bool CanLoadMoreItems(object obj)
    {
        if (Products.Count >= totalItems)
            return false;
        return true;
    }
    
    private async void LoadMoreItems(object obj)
    {
        var listView = obj as Syncfusion.ListView.XForms.SfListView;
        IsBusy = true;
        await Task.Delay(2500);
        var index = Products.Count;
        var count = index + 3 >= totalItems ? totalItems - index : 3;
        AddProducts(index, count);
        IsBusy = false;
    }
    
    private void AddProducts(int index, int count)
    {
       var name = Names[0];
       var p = new Product()
       {
           Name = name,
           Weight = Weights[0],
           Price = Prices[0]
       };
    
       Products.Add(p);
    }

    LoadMoreCommandParameter

    Gets or sets the parameter for LoadMoreCommand.

    Declaration
    public object LoadMoreCommandParameter { get; set; }
    Property Value
    Type
    System.Object
    Examples
    SfListView listView = new SfListView();
    ViewModel viewModel = new ViewModel();
    listView.ItemsSource = viewModel.Products;
    listView.LoadMoreOption = LoadMoreOption.Manual;
    listView.LoadMoreCommand = viewModel.LoadMoreItemsCommand;
    listView.SetBinding(SfListView.IsBusyProperty, new Binding("IsBusy"));
    
    //ViewModel.cs
    private bool isBusy;
    public bool IsBusy
    {
        get { return isBusy; }
        set
        {
            this.isBusy = value;
            RaisePropertyChanged("IsBusy");
        }
    }
    
    LoadMoreItemsCommand = new Command<object>(LoadMoreItems, CanLoadMoreItems);
    
    private bool CanLoadMoreItems(object obj)
    {
        if (Products.Count >= totalItems)
            return false;
        return true;
    }
    
    private async void LoadMoreItems(object obj)
    {
        var listView = obj as Syncfusion.ListView.XForms.SfListView;
        IsBusy = true;
        await Task.Delay(2500);
        var index = Products.Count;
        var count = index + 3 >= totalItems ? totalItems - index : 3;
        AddProducts(index, count);
        IsBusy = false;
    }
    
    private void AddProducts(int index, int count)
    {
       var name = Names[0];
       var p = new Product()
       {
           Name = name,
           Weight = Weights[0],
           Price = Prices[0],
           Image = ImageSource.FromResource("LoadMoreUG.LoadMore." + name.Replace(" ", string.Empty) + ".jpg")
       };
    
       Products.Add(p);
    }

    LoadMoreOption

    Gets or sets the option which determines the behavior of load more items. If it is None, load more support will not be enabled. This is the default value.
    If it is Auto, automatically execute the LoadMoreCommand when list view reaches the scroll end.
    If it is Manual, displays load more button when end reached and execute the LoadMoreCommand when tap on button. For Horizontal, Manual is not supported. For Top, Auto is not supported.

    Declaration
    public LoadMoreOption LoadMoreOption { get; set; }
    Property Value
    Type
    LoadMoreOption
    Examples
    SfListView listView = new SfListView();
    listView.LoadMoreOption = LoadMoreOption.Manual;

    LoadMorePosition

    Gets or sets the position which determines where the load more item should be positioned. If it is Top, load more item will be added on the top of the list.
    If it is Top and Horizontal, the load more item will be in the left corner of the list. If it is Bottom, the load more item will be added at the bottom of the list. This is the default value.
    If it is Bottom and Horizontal, the load more item will be in the right corner of the list.

    Declaration
    public LoadMorePosition LoadMorePosition { get; set; }
    Property Value
    Type
    LoadMorePosition
    Examples
    SfListView listView = new SfListView();
    listView.LoadMorePosition = LoadMorePosition.Top;

    LoadMoreTemplate

    Gets or sets the Xamarin.Forms.DataTemplate which will be loaded as a LoadMoreItem. If it is null, the default load more view will be loaded.

    Declaration
    public DataTemplate LoadMoreTemplate { get; set; }
    Property Value
    Type
    Xamarin.Forms.DataTemplate
    Examples
    SfListView listView = new SfListView();
    listView.ItemsSource = viewModel.BookInfo;
    listView.LoadMoreTemplate = new DataTemplate(() =>
    {
       var grid = new Grid();
       var label = new Label
       {
           Text = "Click here to Load More Items...",
           FontSize = 20,
           BackgroundColor = Color.AliceBlue,
           HorizontalTextAlignment = TextAlignment.Center,
           VerticalTextAlignment = TextAlignment.Center
       };
       label.SetBinding(Label.IsVisibleProperty, new Binding("IsBusy", BindingMode.Default, new InverseBoolConverter()));
       grid.Children.Add(label);
       return grid;
    });

    Orientation

    Gets or sets the orientation for SfListView. The default orientation is vertical.

    Declaration
    public Orientation Orientation { get; set; }
    Property Value
    Type
    Orientation
    Examples
    SfListView listView = new SfListView();
    listView.Orientation = Orientation.Horizontal;

    RightSwipeTemplate

    Gets or sets the template that is used to display when SwipeDirection is Right and Top.

    Declaration
    public DataTemplate RightSwipeTemplate { get; set; }
    Property Value
    Type
    Xamarin.Forms.DataTemplate
    Examples
    SfListView listView = new SfListView();
    listView.AllowSwiping = true;
    listView.SwipeOffset = 60;
    listView.SwipeThreshold = 30;
    listView.RightSwipeTemplate = new DataTemplate(() =>
    {
       var grid = new Grid();
    
       var grid1 = new Grid()
       {
           BackgroundColor = Color.FromHex("#009EDA"),
           HorizontalOptions = LayoutOptions.Fill,
           VerticalOptions = LayoutOptions.Fill
       };
       var favoriteGrid = new Grid() { HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center };
       var favoriteImage = new Image() { BackgroundColor = Color.Transparent, HeightRequest = 35, WidthRequest = 35 };
       favoriteImage.Source = ImageSource.FromResource("Swiping.Images.Favorites.png");
       favoriteGrid.Children.Add(favoriteImage);
       grid1.Children.Add(favoriteGrid);
    
       grid.Children.Add(grid1);
    
       return grid;
    
    });

    SelectedItem

    Gets or sets the first selected item.

    Declaration
    public object SelectedItem { get; set; }
    Property Value
    Type Description
    System.Object

    The selected item.

    Examples
    SfListView listView = new SfListView();
    ViewModel viewModel = new ViewModel();
    listView.ItemsSource = viewModel.BookInfo;
    listView.SelectedItem = viewModel.BookInfo[2];

    SelectedItems

    Gets the selected items for selection.

    Declaration
    public ObservableCollection<object> SelectedItems { get; }
    Property Value
    Type
    System.Collections.ObjectModel.ObservableCollection<System.Object>
    Examples
    SfListView listView = new SfListView();
    ViewModel viewModel = new ViewModel();
    listView.ItemsSource = viewModel.Products;
    listView.SelectionMode = SelectionMode.Multiple;
    listView.SelectedItems = viewModel.SelectedItems;
    
    //ViewModel
    public ObservableCollection<object> Products{ get; set; }
    private ObservableCollection<object> selectedItems; 
    public ObservableCollection<object> SelectedItems
    {
        get
        {
            return selectedItems;
        }
        set
        {
                selectedItems = value;
            }
        }
    
    public ViewModel()
    {
        this.Products = GenerateItemsSource();
        this.SelectedItems = new ObservableCollection<object>();
        this.SelectedItems.Add(this.Products[1]);
        this.SelectedItems.Add(this.Products[2]);
        this.SelectedItems.Add(this.Products[3]);
    }

    SelectedItemTemplate

    Gets or sets the selected item template for selection.

    Declaration
    public DataTemplate SelectedItemTemplate { get; set; }
    Property Value
    Type
    Xamarin.Forms.DataTemplate
    Examples
    ViewModel viewModel = new ViewModel();
    SfListView listView = new SfListView();
    listView.ItemsSource = viewModel.BookInfo;
    listView.SelectedItemTemplate = new DataTemplate(() =>
    {
       var grid = new Grid();
       grid.BackgroundColor = Color.FromHex("#4CA1FE");
       var bookNameLabel = new Label
       {
           BackgroundColor = Color.White,
           FontSize = 18,
           FontAttributes = FontAttributes.Bold,
       };
       bookNameLabel.SetBinding(Label.TextProperty, "BookName");
       grid.Children.Add(footerLabel);
    
       return grid;
    });

    SelectionBackgroundColor

    Gets or sets the selection background color for the selected item.

    Declaration
    public Color SelectionBackgroundColor { get; set; }
    Property Value
    Type
    Xamarin.Forms.Color
    Examples
    SfListView listView = new SfListView();
    listView.SelectionBackgroundColor = Color.Green;

    SelectionChangedCommand

    Gets or sets the System.Windows.Input.ICommand to be executed when the selection is changed.

    Declaration
    public ICommand SelectionChangedCommand { get; set; }
    Property Value
    Type
    System.Windows.Input.ICommand
    Examples
    SfListView listView = new SfListView();
    ViewModel viewModel = new ViewModel();
    listView.SelectionChangedCommand = viewModel.ListViewSelectionChangedCommand;
    
    public class CommandViewModel
    {
        private Command<Object> selectionChangedCommand;
        public Command<object> ListViewSelectionChagedCommand
        {
           get { return selectionChangedCommand; }
           set { selectionChangedCommand = value; }
        }
        public CommandViewModel()
        {
            ListViewSelectionChagedCommand = new Command<object>(SelectionChagedCommandMethod);
        }
        private void SelectionChagedCommandMethod(object obj)
        {
            listView.SelectedItems.Clear();
        }
    }

    SelectionChangedCommandParameter

    Gets or sets the parameter for SelectionChangedCommand.

    Declaration
    public object SelectionChangedCommandParameter { get; set; }
    Property Value
    Type
    System.Object
    Remarks

    The default value of SelectionChangedCommandParameter is null. if SelectionChangedCommandParameter is not defined then ItemSelectionChangedEventArgs will be passed as argument.

    SelectionController

    Gets or sets the SelectionController which controls the selection and its related operations.

    Declaration
    public SelectionController SelectionController { get; set; }
    Property Value
    Type Description
    SelectionController

    An instance of SelectionController.

    Examples
    SfListView listView = new SfListView();
    listView.SelectionController = new SelectionControllerExt(listView);
    
    public class SelectionControllerExt : SelectionController
    {
        public SelectionControllerExt(SfListView listView) : base(listView)
        {
        }
    
        protected override void AnimateSelectedItem(ListViewItem selectedListViewItem)
        {
            base.AnimateSelectedItem(selectedListViewItem);
            selectedListViewItem.Opacity = 0;
            selectedListViewItem.FadeTo(1, 3000, Easing.SinInOut);
        }
    }

    SelectionGesture

    Gets or sets the selection gesture for selection.

    Declaration
    public TouchGesture SelectionGesture { get; set; }
    Property Value
    Type
    TouchGesture
    Remarks

    By default value, the SelectionGesture is TouchGesture.Tap.

    Examples
    SfListView listView = new SfListView();
    listView.SelectionGesture = TouchGesture.Hold;

    SelectionMode

    Gets or sets the selection mode for selection.

    Declaration
    public SelectionMode SelectionMode { get; set; }
    Property Value
    Type
    SelectionMode
    Remarks

    By default value, the SelectionMode is SelectionMode.Single.

    Examples
    SfListView listView = new SfListView();
    listView.SelectionMode = SelectionMode.SingleDeselect;

    StickyFooterPosition

    Gets or sets a value indicating whether to display the sticky footer inside the body of the ListView when items are less than the body size.

    Declaration
    public FooterPosition StickyFooterPosition { get; set; }
    Property Value
    Type
    FooterPosition
    Remarks

    This API is applicable when IsStickyFooter is enabled. If the value is 'Default', it will be placed at the end of the ListView and if the value is 'Body', it will be placed inside the body of the ListView when items are less than the body size.

    Examples
    SfListView listView = new SfListView();
    listView.StickyFooterPosition = FooterPosition.Body;

    SwipeOffset

    Gets or sets the value how much the swiped item will be moved to the side and stick there. The default value is 100.

    Declaration
    public double SwipeOffset { get; set; }
    Property Value
    Type Description
    System.Double

    The swipe offset value.

    Examples
    SfListView listView = new SfListView();
    listView.AllowSwiping = true;
    listView.SwipeOffset = 60;

    SwipeThreshold

    Gets or sets the value that indicates SwipeView gets stick when Syncfusion.ListView.XForms.ListViewItemInfoBase.SwipeOffset is greater than half of the SwipeThreshold value. The default value is 0.

    Declaration
    public double SwipeThreshold { get; set; }
    Property Value
    Type Description
    System.Double

    The swipe threshold value.

    Examples
    SfListView listView = new SfListView();
    listView.AllowSwiping = true;
    listView.SwipeOffset = 60;
    listView.SwipeThreshold = 30;

    TapCommand

    Gets or sets the System.Windows.Input.ICommand which will be executed when tapping the ListViewItem.

    Declaration
    public ICommand TapCommand { get; set; }
    Property Value
    Type
    System.Windows.Input.ICommand
    Examples
    SfListView listView = new SfListView();
    ViewModel viewModel = new ViewModel();
    listView.TapCommand = viewModel.TappedCommand;
    
    public class CommandViewModel
    {
      private Command<Object> tappedCommand;
    
      public Command<object> TappedCommand
      {
          get { return tappedCommand; }
          set { tappedCommand = value; }
      }
    
      public CommandViewModel()
      {
          TappedCommand = new Command<object>(TappedCommandMethod);
      }
    
      private void TappedCommandMethod(object obj)
      {
          if ((obj as Syncfusion.ListView.XForms.ItemTappedEventArgs).ItemData == viewModel.InboxInfo[0])
              viewModel.InboxInfo.Remove((obj as Syncfusion.ListView.XForms.ItemTappedEventArgs).ItemData as ListViewInboxInfo)
      }
    }

    TapCommandParameter

    Gets or sets the parameter for TapCommand.

    Declaration
    public object TapCommandParameter { get; set; }
    Property Value
    Type
    System.Object
    Remarks

    The default value is ItemTappedEventArgs.

    Methods

    add_GroupCollapsed(GroupExpandCollapseChangedEventHandler)

    Declaration
    public void add_GroupCollapsed(GroupExpandCollapseChangedEventHandler value)
    Parameters
    Type Name Description
    GroupExpandCollapseChangedEventHandler value

    add_GroupCollapsing(GroupExpandCollapseChangingEventHandler)

    Declaration
    public void add_GroupCollapsing(GroupExpandCollapseChangingEventHandler value)
    Parameters
    Type Name Description
    GroupExpandCollapseChangingEventHandler value

    add_GroupExpanded(GroupExpandCollapseChangedEventHandler)

    Declaration
    public void add_GroupExpanded(GroupExpandCollapseChangedEventHandler value)
    Parameters
    Type Name Description
    GroupExpandCollapseChangedEventHandler value

    add_GroupExpanding(GroupExpandCollapseChangingEventHandler)

    Declaration
    public void add_GroupExpanding(GroupExpandCollapseChangingEventHandler value)
    Parameters
    Type Name Description
    GroupExpandCollapseChangingEventHandler value

    add_ItemAppearing(ItemAppearingEventHandler)

    Declaration
    public void add_ItemAppearing(ItemAppearingEventHandler value)
    Parameters
    Type Name Description
    ItemAppearingEventHandler value

    add_ItemDisappearing(ItemDisappearingEventHandler)

    Declaration
    public void add_ItemDisappearing(ItemDisappearingEventHandler value)
    Parameters
    Type Name Description
    ItemDisappearingEventHandler value

    add_ItemDoubleTapped(ItemDoubleTappedEventHandler)

    Declaration
    public void add_ItemDoubleTapped(ItemDoubleTappedEventHandler value)
    Parameters
    Type Name Description
    ItemDoubleTappedEventHandler value

    add_ItemDragging(ItemDraggingEventHandler)

    Declaration
    public void add_ItemDragging(ItemDraggingEventHandler value)
    Parameters
    Type Name Description
    ItemDraggingEventHandler value

    add_ItemHolding(ItemHoldingEventHandler)

    Declaration
    public void add_ItemHolding(ItemHoldingEventHandler value)
    Parameters
    Type Name Description
    ItemHoldingEventHandler value

    add_ItemTapped(ItemTappedEventHandler)

    Declaration
    public void add_ItemTapped(ItemTappedEventHandler value)
    Parameters
    Type Name Description
    ItemTappedEventHandler value

    add_Loaded(ListViewLoadedEventHandler)

    Declaration
    public void add_Loaded(ListViewLoadedEventHandler value)
    Parameters
    Type Name Description
    ListViewLoadedEventHandler value

    add_QueryItemSize(QueryItemSizeEventHandler)

    Declaration
    public void add_QueryItemSize(QueryItemSizeEventHandler value)
    Parameters
    Type Name Description
    QueryItemSizeEventHandler value

    add_ScrollStateChanged(ScrollStateChangedEventHandler)

    Declaration
    public void add_ScrollStateChanged(ScrollStateChangedEventHandler value)
    Parameters
    Type Name Description
    ScrollStateChangedEventHandler value

    add_SelectionChanged(ItemSelectionChangedEventHandler)

    Declaration
    public void add_SelectionChanged(ItemSelectionChangedEventHandler value)
    Parameters
    Type Name Description
    ItemSelectionChangedEventHandler value

    add_SelectionChanging(ItemSelectionChangingEventHandler)

    Declaration
    public void add_SelectionChanging(ItemSelectionChangingEventHandler value)
    Parameters
    Type Name Description
    ItemSelectionChangingEventHandler value

    add_SwipeEnded(SwipeEndedEventHandler)

    Declaration
    public void add_SwipeEnded(SwipeEndedEventHandler value)
    Parameters
    Type Name Description
    SwipeEndedEventHandler value

    add_SwipeReset(ResetSwipeEventHandler)

    Declaration
    public void add_SwipeReset(ResetSwipeEventHandler value)
    Parameters
    Type Name Description
    ResetSwipeEventHandler value

    add_SwipeStarted(SwipeStartedEventHandler)

    Declaration
    public void add_SwipeStarted(SwipeStartedEventHandler value)
    Parameters
    Type Name Description
    SwipeStartedEventHandler value

    add_Swiping(SwipingEventHandler)

    Declaration
    public void add_Swiping(SwipingEventHandler value)
    Parameters
    Type Name Description
    SwipingEventHandler value

    CanHandleGesture(Object)

    Checks whether need to handle pulling gesture.

    Declaration
    public bool CanHandleGesture(object pullToRefresh)
    Parameters
    Type Name Description
    System.Object pullToRefresh

    Indicates the pullToRefresh control.

    Returns
    Type Description
    System.Boolean

    If true, handles the pulling action.

    CollapseAll()

    Collapses all the groups in Groups.

    Declaration
    public void CollapseAll()
    Remarks

    This method collapse all the groups in Groups programmatically.

    CollapseGroup(GroupResult)

    Collapses the specified group.

    Declaration
    public void CollapseGroup(GroupResult group)
    Parameters
    Type Name Description
    GroupResult group

    Specifies the GroupResult to collapse it from view.

    Examples
            
                 var group = (listview.DataSource.Groups[0] as Group);
                   this.listview.CollapseGroup(group);

    Dispose()

    Disposes all allocated resources.

    Declaration
    public void Dispose()

    Dispose(Boolean)

    Dispose the instances, if parameter is true.

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    Represents the boolean value for disposing objects.

    ExpandAll()

    Expands all the groups in Groups.

    Declaration
    public void ExpandAll()
    Remarks

    This method expand all the groups in Groups programmatically.

    ExpandGroup(GroupResult)

    Expands the specified group.

    Declaration
    public void ExpandGroup(GroupResult group)
    Parameters
    Type Name Description
    GroupResult group

    Specifies the GroupResult to expand it from view.

    Examples
            
                 var group = (listview.DataSource.Groups[0] as Group);
                   this.listview.ExpandGroup(group);

    ForceUpdateItemSize(Int32)

    Helper method to refresh a particular item or entire listView items.

    Declaration
    public void ForceUpdateItemSize(int itemIndex = -1)
    Parameters
    Type Name Description
    System.Int32 itemIndex

    This is optional parameter. If needs to update particular item, then pass that item's index. If needs to update more than one item, then don't pass the parameter.

    LayoutChildren(Double, Double, Double, Double)

    Override method to layout the SfListView children.

    Declaration
    protected override void LayoutChildren(double x, double y, double width, double height)
    Parameters
    Type Name Description
    System.Double x

    Represents the 'x' position to layout the children.

    System.Double y

    Represents the 'y' position to layout the children.

    System.Double width

    Represents the width of the child element.

    System.Double height

    Represents the height of the child element.

    OnMeasure(Double, Double)

    This method is called during the measure pass of a layout cycle to get the desired size of an element.

    Declaration
    protected override SizeRequest OnMeasure(double widthConstraint, double heightConstraint)
    Parameters
    Type Name Description
    System.Double widthConstraint

    The available width for the element to use.

    System.Double heightConstraint

    The available height for the element to use.

    Returns
    Type Description
    Xamarin.Forms.SizeRequest

    A Xamarin.Forms.SizeRequest which contains the desired size of the element.

    Remarks

    The results of this method will be (-1, -1) if the element has not yet been realized with a platform specific backing control. Overriding this method does not require a call to the base class so long as a valid SizeRequest is returned.

    OnPropertyChanged(String)

    Need to handle the run time changes of System.ComponentModel.PropertyChangedEventArgs of SfListView.

    Declaration
    protected override void OnPropertyChanged(string propertyName = null)
    Parameters
    Type Name Description
    System.String propertyName

    Represents the property changed event arguments.

    OnSizeAllocated(Double, Double)

    Override method to allocate the total size of the SfListView.

    Declaration
    protected override void OnSizeAllocated(double width, double height)
    Parameters
    Type Name Description
    System.Double width

    Represents the width of the SfListView.

    System.Double height

    Represents the height of the SfListView.

    Pulling(Double, Object, out Boolean)

    Occurs when the pulling gesture action is started.

    Declaration
    public void Pulling(double progress, object pullToRefresh, out bool cancel)
    Parameters
    Type Name Description
    System.Double progress

    Indicates the progress indicator value.

    System.Object pullToRefresh

    Indicates the pullToRefresh control.

    System.Boolean cancel

    Gets or sets a value indicating whether pulling should be handled.

    PullingCancelled(Object)

    Occurs when the pulling is cancelled.

    Declaration
    public void PullingCancelled(object pullToRefresh)
    Parameters
    Type Name Description
    System.Object pullToRefresh

    Indicates the pullToRefresh control.

    Refreshed(Object)

    Occurs when the view gets refreshed.

    Declaration
    public void Refreshed(object pullToRefresh)
    Parameters
    Type Name Description
    System.Object pullToRefresh

    Indicates the pullToRefresh control.

    Refreshing(Object)

    Occurs when the pulling gesture action is completed.

    Declaration
    public void Refreshing(object pullToRefresh)
    Parameters
    Type Name Description
    System.Object pullToRefresh

    Indicates the pullToRefresh control.

    RefreshListViewItem(Int32, Int32, Boolean)

    Helper method to refresh the particular item, range of items or all the items in the listView and also refresh the template.

    Declaration
    public void RefreshListViewItem(int startRowIndex = -1, int endRowIndex = -1, bool canReload = false)
    Parameters
    Type Name Description
    System.Int32 startRowIndex

    Indicates that the start row index to refresh.

    System.Int32 endRowIndex

    Indicates that the end row index to refresh.

    System.Boolean canReload

    Indicates whether to refresh the template or not.

    RefreshView()

    Refreshes the view.

    Declaration
    public void RefreshView()

    remove_GroupCollapsed(GroupExpandCollapseChangedEventHandler)

    Declaration
    public void remove_GroupCollapsed(GroupExpandCollapseChangedEventHandler value)
    Parameters
    Type Name Description
    GroupExpandCollapseChangedEventHandler value

    remove_GroupCollapsing(GroupExpandCollapseChangingEventHandler)

    Declaration
    public void remove_GroupCollapsing(GroupExpandCollapseChangingEventHandler value)
    Parameters
    Type Name Description
    GroupExpandCollapseChangingEventHandler value

    remove_GroupExpanded(GroupExpandCollapseChangedEventHandler)

    Declaration
    public void remove_GroupExpanded(GroupExpandCollapseChangedEventHandler value)
    Parameters
    Type Name Description
    GroupExpandCollapseChangedEventHandler value

    remove_GroupExpanding(GroupExpandCollapseChangingEventHandler)

    Declaration
    public void remove_GroupExpanding(GroupExpandCollapseChangingEventHandler value)
    Parameters
    Type Name Description
    GroupExpandCollapseChangingEventHandler value

    remove_ItemAppearing(ItemAppearingEventHandler)

    Declaration
    public void remove_ItemAppearing(ItemAppearingEventHandler value)
    Parameters
    Type Name Description
    ItemAppearingEventHandler value

    remove_ItemDisappearing(ItemDisappearingEventHandler)

    Declaration
    public void remove_ItemDisappearing(ItemDisappearingEventHandler value)
    Parameters
    Type Name Description
    ItemDisappearingEventHandler value

    remove_ItemDoubleTapped(ItemDoubleTappedEventHandler)

    Declaration
    public void remove_ItemDoubleTapped(ItemDoubleTappedEventHandler value)
    Parameters
    Type Name Description
    ItemDoubleTappedEventHandler value

    remove_ItemDragging(ItemDraggingEventHandler)

    Declaration
    public void remove_ItemDragging(ItemDraggingEventHandler value)
    Parameters
    Type Name Description
    ItemDraggingEventHandler value

    remove_ItemHolding(ItemHoldingEventHandler)

    Declaration
    public void remove_ItemHolding(ItemHoldingEventHandler value)
    Parameters
    Type Name Description
    ItemHoldingEventHandler value

    remove_ItemTapped(ItemTappedEventHandler)

    Declaration
    public void remove_ItemTapped(ItemTappedEventHandler value)
    Parameters
    Type Name Description
    ItemTappedEventHandler value

    remove_Loaded(ListViewLoadedEventHandler)

    Declaration
    public void remove_Loaded(ListViewLoadedEventHandler value)
    Parameters
    Type Name Description
    ListViewLoadedEventHandler value

    remove_QueryItemSize(QueryItemSizeEventHandler)

    Declaration
    public void remove_QueryItemSize(QueryItemSizeEventHandler value)
    Parameters
    Type Name Description
    QueryItemSizeEventHandler value

    remove_ScrollStateChanged(ScrollStateChangedEventHandler)

    Declaration
    public void remove_ScrollStateChanged(ScrollStateChangedEventHandler value)
    Parameters
    Type Name Description
    ScrollStateChangedEventHandler value

    remove_SelectionChanged(ItemSelectionChangedEventHandler)

    Declaration
    public void remove_SelectionChanged(ItemSelectionChangedEventHandler value)
    Parameters
    Type Name Description
    ItemSelectionChangedEventHandler value

    remove_SelectionChanging(ItemSelectionChangingEventHandler)

    Declaration
    public void remove_SelectionChanging(ItemSelectionChangingEventHandler value)
    Parameters
    Type Name Description
    ItemSelectionChangingEventHandler value

    remove_SwipeEnded(SwipeEndedEventHandler)

    Declaration
    public void remove_SwipeEnded(SwipeEndedEventHandler value)
    Parameters
    Type Name Description
    SwipeEndedEventHandler value

    remove_SwipeReset(ResetSwipeEventHandler)

    Declaration
    public void remove_SwipeReset(ResetSwipeEventHandler value)
    Parameters
    Type Name Description
    ResetSwipeEventHandler value

    remove_SwipeStarted(SwipeStartedEventHandler)

    Declaration
    public void remove_SwipeStarted(SwipeStartedEventHandler value)
    Parameters
    Type Name Description
    SwipeStartedEventHandler value

    remove_Swiping(SwipingEventHandler)

    Declaration
    public void remove_Swiping(SwipingEventHandler value)
    Parameters
    Type Name Description
    SwipingEventHandler value

    ResetSwipe(Boolean)

    Resets the swiping and moves the swiped ListViewItem to its default position.

    Declaration
    public void ResetSwipe(bool canAnimate = false)
    Parameters
    Type Name Description
    System.Boolean canAnimate

    Indicates whether animate the ListViewItem.

    ScrollTo(Double, Boolean)

    Scrolls the SfListView item into given position.

    Declaration
    public void ScrollTo(double position, bool disableAnimation = false)
    Parameters
    Type Name Description
    System.Double position

    The position based on Orientation to scroll.

    System.Boolean disableAnimation

    True to disable scroll animation while changing the view; otherwise, false. The default is false.

    Examples
    SfListView listView = new SfListView();
    listView.ScrollTo(1000, true);

    ScrollTo(Object, ScrollToPosition, Boolean)

    Scrolls the SfListView item into given data object.

    Declaration
    public void ScrollTo(object itemData, ScrollToPosition scrollToPosition, bool disableAnimation = false)
    Parameters
    Type Name Description
    System.Object itemData

    Represents the data object.

    ScrollToPosition scrollToPosition

    Defines position in the view to which object is scrolled.

    System.Boolean disableAnimation

    True to disable scroll animation while changing the view; otherwise, false. The default is false.

    Examples
    SfListView listView = new SfListView();
    ViewModel viewModel = new ViewModel();
    listView.ItemsSource = viewModel.ContactsInfo;
    listView.ScrollTo(ViewModel.ContactsInfo[30], ScrollToPosition.End, true);

    SelectAll()

    Select all the items in the SfListView.

    Declaration
    public void SelectAll()

    ShouldInvalidateOnChildAdded(View)

    Override method to determine whether to invalidate on child added.

    Declaration
    protected override bool ShouldInvalidateOnChildAdded(View child)
    Parameters
    Type Name Description
    Xamarin.Forms.View child

    Represents the View which is to be added.

    Returns
    Type Description
    System.Boolean

    Returns the boolean value accordingly.

    ShouldInvalidateOnChildRemoved(View)

    Override method to determine whether to invalidate on child removed.

    Declaration
    protected override bool ShouldInvalidateOnChildRemoved(View child)
    Parameters
    Type Name Description
    Xamarin.Forms.View child

    Represents the View which is to be removed.

    Returns
    Type Description
    System.Boolean

    Returns the boolean value accordingly.

    SwipeItem(Object, Double)

    Swipe an item programmatically based on the given offset value.

    Declaration
    public void SwipeItem(object itemData, double offset)
    Parameters
    Type Name Description
    System.Object itemData

    Represents the item data of list view item.

    System.Double offset

    Represents the value that how much the item need to swipe.

    Examples
    SfListView listView = new SfListView();
    ViewModel viewModel = new ViewModel();
    listView.ItemsSource = viewModel.BookInfo;
    // LeftSwipe
    listView.SwipeItem(viewModel.BookInfo[3], 200);
    // RightSwipe
    listView.SwipeItem(viewModel.BookInfo[3], -200);

    Events

    GroupCollapsed

    Occurs when a group is collapsed.

    Declaration
    public event GroupExpandCollapseChangedEventHandler GroupCollapsed
    Event Type
    Type
    GroupExpandCollapseChangedEventHandler
    Remarks

    This event occurs after the GroupCollapsing event if that event is not canceled.

    Examples

    The following example demonstrates how to wire the group collapsed event in SfListView.

    listView.GroupCollapsed += ListView_GroupCollapsed;
    

    private void ListView_GroupCollapsed(object sender, GroupExpandCollapseChangingEventArgs e) { // Do required actions here. }

    See Also
    GroupCollapsing
    GroupExpanding
    GroupExpanded

    GroupCollapsing

    Occurs when a group is being collapsed.

    Declaration
    public event GroupExpandCollapseChangingEventHandler GroupCollapsing
    Event Type
    Type
    GroupExpandCollapseChangingEventHandler
    Remarks

    The GroupCollapsing event is a cancelable event and can be canceled by handling the event and setting the Cancel property to true. However, if the event is canceled, the group collapsing process for the tapped GroupHeaderItem gets cancelled. Also, we can customize the group being collapsed through GroupExpandCollapseChangingEventArgs event argument.

    Examples

    The following example demonstrates how to wire the group collapsing event in SfListView.

    listView.GroupCollapsing += ListView_GroupCollapsing;
    

    private void ListView_GroupCollapsing(object sender, GroupExpandCollapseChangingEventArgs e) { if (e.Groups[0] == listView.DataSource.Groups[0]) e.Cancel = true; }

    See Also
    GroupCollapsed
    GroupExpanding
    GroupExpanded

    GroupExpanded

    Occurs when a group is expanded.

    Declaration
    public event GroupExpandCollapseChangedEventHandler GroupExpanded
    Event Type
    Type
    GroupExpandCollapseChangedEventHandler
    Remarks

    This event occurs after the GroupExpanding event if that event is not canceled.

    Examples

    The following example demonstrates how to wire the group expanded event in SfListView.

    listView.GroupExpanded += ListView_GroupExpanded;
    

    private void ListView_GroupExpanded(object sender, GroupExpandCollapseChangingEventArgs e) { // Do required actions here. }

    See Also
    GroupExpanding
    GroupCollapsing
    GroupCollapsed

    GroupExpanding

    Occurs when a group is being expanded.

    Declaration
    public event GroupExpandCollapseChangingEventHandler GroupExpanding
    Event Type
    Type
    GroupExpandCollapseChangingEventHandler
    Remarks

    The GroupExpanding event is a cancelable event and can be canceled by handling the event and setting the Cancel property to true. However, if the event is canceled, the group expanding process for the tapped GroupHeaderItem gets cancelled. Also, we can customize the group being expanded through GroupExpandCollapseChangingEventArgs event argument.

    Examples

    The following example demonstrates how to wire the group expanding event in SfListView.

    listView.GroupExpanding += ListView_GroupExpanding;
    

    private void ListView_GroupExpanding(object sender, GroupExpandCollapseChangingEventArgs e) { if (e.Groups[0] == listView.DataSource.Groups[0]) e.Cancel = true; }

    See Also
    GroupExpanded
    GroupCollapsing
    GroupCollapsed

    ItemAppearing

    Occurs when the visual representation of a ListViewItem is being added to the Syncfusion.ListView.XForms.SfListView.VisualContainer.

    Declaration
    public event ItemAppearingEventHandler ItemAppearing
    Event Type
    Type
    ItemAppearingEventHandler
    Remarks

    The ItemAppearing event is raised when the items are appearing in the view on scrolling, loading, and navigating from one page to another page.

    Examples

    The following example demonstrates how to wire an item appearing event in SfListView.

    listView.ItemsSource = viewModel.BookInfo;
    listView.ItemAppearing += listView_ItemAppearing;
    

    private void listView_ItemAppearing(object sender, ItemAppearingEventArgs e) { if (e.ItemData == viewModel.BookInfo[0]) Debug.WriteLine((e.ItemData as BookInfo).BookName); // If the ItemData value is "Header", then it's a header item. if (e.ItemData == "Header") Debug.WriteLine("Header is Appeared"); }

    ItemDisappearing

    Occurs when the visual representation of a ListViewItem is being removed from the Syncfusion.ListView.XForms.SfListView.VisualContainer.

    Declaration
    public event ItemDisappearingEventHandler ItemDisappearing
    Event Type
    Type
    ItemDisappearingEventHandler
    Remarks

    The ItemDisappearing event is raised when the items disappearing in the view on scrolling, disposing, and navigating from one page to another page.

    Examples

    The following example demonstrates how to wire an item disappearing event in SfListView.

    listView.ItemsSource = viewModel.BookInfo;
    listView.ItemDisappearing += listView_ItemDisappearing;
    

    private void listView_ItemDisappearing(object sender, ItemDisappearingEventArgs e) { if (e.ItemData == viewModel.BookInfo[0]) Debug.WriteLine((e.ItemData as BookInfo).BookName); // If the ItemData value is "Footer" then it's a Footer item. if (e.ItemData == "Footer") Debug.WriteLine("Footer is Disappeared"); }

    ItemDoubleTapped

    Occurs when an item is double tapped.

    Declaration
    public event ItemDoubleTappedEventHandler ItemDoubleTapped
    Event Type
    Type
    ItemDoubleTappedEventHandler
    Examples

    The following example demonstrates how to wire a double tapped event in SfListView.

    listView.ItemsSource = viewModel.InboxInfo;
    listView.ItemDoubleTapped += ListView_ItemDoubleTapped;
    

    private void ListView_ItemDoubleTapped(object sender, ItemDoubleTappedEventArgs e) { var listViewInboxInfo = new ListViewInboxInfo(); listViewInboxInfo.Title = "Bryce Thomas"; listViewInboxInfo.Subject = "Congratulations on the move!"; viewModel.InboxInfo.Add(listViewInboxInfo); }

    ItemDragging

    This event occurs while perform the item drag and drop operation and denotes the drag action by DragAction.

    Declaration
    public event ItemDraggingEventHandler ItemDragging
    Event Type
    Type
    ItemDraggingEventHandler
    Examples
    The following example demonstrates how to wire the ItemDragging event in SfListView.
    
    listView.ItemDragging += ListView_ItemDragging;
    
    private void ListView_ItemDragging(object sender, ItemDraggingEventArgs e)
    {
        // Disable the dragging for 4th item.
        if (e.NewIndex == 3)
            e.Cancel = true;
    }

    ItemHolding

    Occurs when an item is long pressed.

    Declaration
    public event ItemHoldingEventHandler ItemHolding
    Event Type
    Type
    ItemHoldingEventHandler
    Examples

    The following example demonstrates how to wire a holding event in SfListView.

    listView.ItemsSource = viewModel.InboxInfo;
    listView.ItemHolding += ListView_ItemHolding;
    

    private void ListView_ItemHolding(object sender, ItemHoldingEventArgs e) { if (e.ItemData == viewModel.InboxInfo[0]) viewModel.InboxInfo.Remove(e.ItemData as ListViewInboxInfo); }

    ItemTapped

    Occurs when an item is tapped.

    Declaration
    public event ItemTappedEventHandler ItemTapped
    Event Type
    Type
    ItemTappedEventHandler
    Examples

    The following example demonstrates how to wire a tapped event in SfListView.

    listView.ItemsSource = viewModel.InboxInfo;
    listView.ItemTapped += ListView_ItemTapped;
    

    private void ListView_ItemTapped(object sender, ItemTappedEventArgs e) { viewModel.InboxInfo.Remove(e.ItemData as ListViewInboxInfo); }

    Loaded

    Occurs when a SfListView is loaded for the first time.

    Declaration
    public event ListViewLoadedEventHandler Loaded
    Event Type
    Type
    ListViewLoadedEventHandler
    Remarks

    This event occurs only once when a SfListView is loaded in view for the first time. Any properties set in this event call back will lead to an additional refresh call when the SfListView is loaded.

    Examples

    The following example demonstrates how to wire the Loaded event in SfListView.

    listView.Loaded += ListView_Loaded;
    

    private void ListView_Loaded(object sender, ListViewLoadedEventArgs e) { listView.SelectedItems.Add(viewModel.Customers[2]); }

    QueryItemSize

    Occurs whenever an item comes into view and query the item size.

    Declaration
    public event QueryItemSizeEventHandler QueryItemSize
    Event Type
    Type
    QueryItemSizeEventHandler
    Remarks

    We can define whether the specified size can be set to the item or not by handling the QueryItemSize event. When the Handled property in the QueryItemSizeEventArgs argument is false, the decided size will not be set to the item.

    Examples

    The following example demonstrates how to wire the QueryItemSize event in SfListView.

    listView.QueryItemSize += ListView_QueryItemSize;
    

    private void ListView_QueryItemSize(object sender, QueryItemSizeEventArgs e) { if (e.ItemIndex == 1) { e.ItemSize = 300; e.Handled = true; } }

    ScrollStateChanged

    Occurs when the SfListView's scrolling state changed.

    Declaration
    public event ScrollStateChangedEventHandler ScrollStateChanged
    Event Type
    Type
    ScrollStateChangedEventHandler
    Remarks

    For horizontal orientation, it works only from Android API level 23.

    Examples

    The following example demonstrates how to wire the ScrollStateChanged event in SfListView.

    listView.ScrollStateChanged += ListView_ScrollStateChanged;
    

    private void ListView_ScrollStateChanged(object sender, ScrollStateChangedEventArgs e) { if (e.ScrollState == ScrollState.Idle) DisplayAlert("ScrollState", "Scrolling has stopped", "OK"); }

    SelectionChanged

    Occurs once the selection process has been completed for selected item in SfListView.

    Declaration
    public event ItemSelectionChangedEventHandler SelectionChanged
    Event Type
    Type
    ItemSelectionChangedEventHandler
    Examples

    The following example demonstrates how to wire the selection changed event in SfListView.

    listView.SelectionChanged += ListView_OnSelectionChanged;  
    

    private void ListView_OnSelectionChanged(object sender, ItemSelectionChangedEventArgs e) { listView.SelectedItems.Clear(); }

    SelectionChanging

    Occurs when selecting an item at the execution time.

    Declaration
    public event ItemSelectionChangingEventHandler SelectionChanging
    Event Type
    Type
    ItemSelectionChangingEventHandler
    Remarks

    The SelectionChanging event is a cancelable event and can be canceled by handling the event and setting the Cancel property to true. However, if the event is canceled, the selection process for the selected ListViewItem gets cancelled.

    Examples

    The following example demonstrates how to wire the selection changing event in SfListView.

    listView.ItemsSource = viewModel.Items;
    listView.SelectionChanging += ListView_SelectionChanging;  
    

    private void ListView_SelectionChanging(object sender, ItemSelectionChangingEventArgs e) { if (e.AddedItems[0] == ViewModel.Items[0]) e.Cancel = true; }

    SwipeEnded

    Occurs when the swipe action is completed for an item.

    Declaration
    public event SwipeEndedEventHandler SwipeEnded
    Event Type
    Type
    SwipeEndedEventHandler
    Examples

    The following example demonstrates how to wire the swipe ended event in SfListView.

    listView.SwipeEnded += ListView_SwipeEnded;
    

    private void ListView_SwipeEnded(object sender, SwipeEndedEventArgs e) { if (e.SwipeOffset > 70) listView.ResetSwipe(); }

    SwipeReset

    Occurs when the swiped item gets reset.

    Declaration
    public event ResetSwipeEventHandler SwipeReset
    Event Type
    Type
    ResetSwipeEventHandler
    Remarks

    The SwipeReset action can be canceled by setting the Cancel property of the ResetSwipeEventArgs to true.

    Examples

    The following example demonstrates how to wire the swipe reset event in SfListView.

    listView.SwipeReset += ListView_SwipeReset;
    

    private void ListView_SwipeReset(object sender, ResetSwipeEventArgs e) { if (e.ItemIndex == 1) e.Cancel = true; }

    SwipeStarted

    Occurs when the swipe offset changes from its initial value.

    Declaration
    public event SwipeStartedEventHandler SwipeStarted
    Event Type
    Type
    SwipeStartedEventHandler
    Remarks

    The SwipeStarted event is a cancelable event and can be canceled by handling the event and setting the Cancel property to true. However, if the event is canceled, the swipe action for that particular item gets cancelled.

    Examples

    The following example demonstrates how to wire the swipe started event in SfListView.

    listView.SwipeStarted += ListView_SwipeStarted;
    

    private void ListView_SwipeStarted(object sender, SwipeStartedEventArgs e) { if (e.ItemIndex == 1) e.Cancel = true; }

    Swiping

    Occurs when swiping an item is being progress.

    Declaration
    public event SwipingEventHandler Swiping
    Event Type
    Type
    SwipingEventHandler
    Remarks

    The Swiping event can be handled by defining the Handled property in the SwipingEventArgs argument to true which holds the current swipe offset value for the swiped item until the SwipeEnded event is raised.

    Examples

    The following example demonstrates how to wire the swiping event in SfListView.

    listView.Swiping += ListView_Swiping;
    

    private void ListView_Swiping(object sender, SwipingEventArgs e) { if (e.ItemIndex == 1) e.Handled = true; }

    Explicit Interface Implementations

    IParallaxView.ScrollableContentSize

    Gets or sets a value of total scrollable size of the control.

    Declaration
    Size IParallaxView.ScrollableContentSize { get; set; }
    Returns
    Type
    Xamarin.Forms.Size

    IParallaxView.Scrolling

    Occurs when the user scrolls the control.

    Declaration
    event EventHandler<ParallaxScrollingEventArgs> IParallaxView.Scrolling
    Returns
    Type
    System.EventHandler<ParallaxScrollingEventArgs>

    Implements

    IPullToRefresh
    System.IDisposable
    IParallaxView

    Extension Methods

    SfListViewHelper.GetVisualContainer(SfListView)
    SfListViewHelper.GetScrollView(SfListView)
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved