Migrate from Xamarin.Forms SfListView to .NET MAUI SfListView

23 Feb 20242 minutes to read

To migrate easier from Xamarin SfListView to .NET MAUI SfListView, we kept most of the APIs from Xamarin SfListView in MAUI SfListView. However, to maintain the consistency of API naming in MAUI SfListView, we renamed some of the APIs. The APIs that have been changed in MAUI SfListView from Xamarin SfListView are detailed as follows.

Namespaces

Xamarin SfListView .NET MAUI SfListView
Syncfusion.ListView.XForms Syncfusion.Maui.ListView
Syncfusion.ListView.XForms.Control.Helpers Syncfusion.Maui.ListView.Helpers
Syncfusion.DataSource Syncfusion.Maui.DataSource
Syncfusion.DataSource.Extensions Syncfusion.Maui.DataSource.Extensions

Properties

Xamarin SfListView .NET MAUI SfListView Description

HoldCommand

LongPressCommand

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

HoldCommandParameter

LongPressCommandParameter

Gets or sets the parameter for LongPressCommand.

SelectionBackgroundColor

SelectionBackground

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

IsBusy

IsLazyLoading

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

ItemData

ItemTappedEventArgs.DataItem

Gets the item data of the tapped item.

ItemData

ItemLongPressEventArgs.DataItem

Gets the item data of the long pressed item.

ItemData

ItemDoubleTappedEventArgs.DataItem

Gets the item data of the double tapped item.

ItemData

ItemAppearingEventArgs.DataItem

Gets the underlying data object of the ListViewItem when item appearing from the bound data source.

ItemData

ItemDisappearingEventArgs.DataItem

Gets the underlying data object of the ListViewItem when item disappearing from the bound data source.

ItemData

QueryItemSizeEventArgs.DataItem

Gets the underlying data of the queried item.

ItemData

ItemDraggingEventArgs.DataItem

Gets the underlying data object of the ListViewItem that is currently being dragged from the bound data source.

CanAdjustDragItemAxis

CanAdjustDragItemAxis

A property that Gets or sets a value that determines whether to adjust the X position of the drag item for vertical orientation and the Y position for horizontal orientation.

LayoutManager

ItemsLayout

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

Enums

Enum Xamarin SfListView .NET MAUI SfListView Description

LoadMorePosition

Top,
Bottom
Start,
End
Defines position for the load more support of SfListView.

TouchGesture

Hold LongPress Describes the possible values of touch operation. These values are used when updating selection in the SfListView control.

Events

Xamarin SfListView .NET MAUI SfListView Description

ItemHolding

ItemLongPress

Occurs when an item is long pressed.

Classes

Xamarin SfListView .NET MAUI SfListView Description

FooterItem

ListViewFooterItem

Represents the footer item of data in the SfListView control.

FooterPosition

ListViewFooterPosition

Defines the position of the footer when IsStickyFooter is enabled.

GroupHeader

ListViewGroupHeader

Represents the group header item in a SfListView control.

HeaderItem

ListViewHeaderItem

Represents the header item of data in the SfListView control.

ItemHoldingEventArgs

ItemLongPressEventArgs

Provides data for ItemLongPress event.

LoadMoreIndicator

ListViewLoadMoreIndicator

A loading indicator which will be displayed when loading more items into the list view is in progress.

LoadMoreItem

ListViewLoadMoreItem

Represents the load more item in a SfListView control.

LayoutBase

ListViewLayout

Defines the base for the layouts.

InverseBoolConverter

InvertedBoolConverter

Converter to reverse the boolean value.