Migrate from Xamarin.Forms SfTreeView to .NET MAUI SfTreeView

22 Sep 20231 minute to read

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

Namespaces

Xamarin SfTreeView .NET MAUI SfTreeView
Syncfusion.XForms.TreeView Syncfusion.Maui.TreeView

Properties

Xamarin SfTreeView .NET MAUI SfTreeView Description

HoldCommand

LongPressCommand

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

IsScrollBarVisible

ScrollBarVisibility

Gets or sets a value indicating whether or not the scrollbar should be displayed.

SelectionBackgroundColor

SelectionBackground

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

SelectionForegroundColor

SelectionForeground

Gets or sets the selected item foreground color. Note: It will applicable for unbound mode only.

Enums

Xamarin SfTreeView .NET MAUI SfTreeView Description

ItemType

TreeViewItemType

Defines the item type for the TreeViewItemInfoBase.

ExpandActionTarget

TreeViewExpandActionTarget

Defines that the expanding and collapsing of nodes can be performed only by tapping in expander view or in both expander view and content view.

ExpanderPosition

TreeViewExpanderPosition

Defines the expander position of the SfTreeView. The expander can be positioned either start or end of the item.

SelectionMode

TreeViewSelectionMode

Defines constants that specify the selections that are supported by a SfTreeView control.

AutoExpandMode

TreeViewAutoExpandMode

Defines the possible expand modes while loading the nodes in the SfTreeView.

NotificationSubscriptionMode

TreeViewNotificationSubscriptionMode

Defines the constants that specify whether need to listen the PropertyChanging and `System.ComponentModel.INotifyPropertyChanged.PropertyChanged` events of data object and `System.Collections.Specialized.INotifyCollectionChanged.CollectionChanged` event of source collection.

Events

Xamarin SfTreeView .NET MAUI SfTreeView Description

ItemHolding

ItemLongPress

Occurs when the TreeViewItem's ContentView is long pressed.

Upcoming features

  • Animation
  • Checkbox
  • LoadOnDemand