Class LayoutBase
Defines the base for the layouts.
Namespace: Syncfusion.ListView.XForms
Assembly: Syncfusion.SfListView.XForms.dll
Syntax
public abstract class LayoutBase : BindableObject
Constructors
LayoutBase()
Declaration
protected LayoutBase()
Properties
ItemsCacheLimit
Gets or sets the cache limit for create and reuse the ListViewItems if different templates are used in Xamarin.Forms.DataTemplateSelector for better scrolling performance.
Declaration
public int ItemsCacheLimit { get; set; }
Property Value
Type |
---|
System.Int32 |
Remarks
Based on this value, SfListView creates the number of ListViewItems for different templates in the view and if new template is created while scrolling and reuse it if same template is used for improving the scrolling performance.
Methods
ScrollToRowIndex(Int32, ScrollToPosition, Boolean)
Scrolls the SfListView to the row at the given index.
Declaration
public void ScrollToRowIndex(int rowIndex, ScrollToPosition scrollToPosition, bool disableAnimation = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The index of the row to scroll. |
ScrollToPosition | scrollToPosition | Defines position in the view to which row index is scrolled. |
System.Boolean | disableAnimation | true to disable scroll animation while changing the view; otherwise, false. The default is false. |
Remarks
When AutoFitMode is height or 'DynamicHeight', scroll animation will be disabled by default in android and iOS. If it is called while loading SfListView, then set disableAnimation as true to scroll to appropriate row index, else view doesn't scrolled in android.
Examples
SfListView listView = new SfListView();
int index = listView.DataSource.DisplayItems.IndexOf(viewModel.Customers[2]);
listView.LayoutManager.ScrollToRowIndex(index, ScrollToPosition.MakeVisible , true);
ScrollToRowIndex(Int32, Boolean)
Scrolls the SfListView to the row at the given index.
Declaration
public void ScrollToRowIndex(int rowIndex, bool disableAnimation = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The index of the row to scroll. |
System.Boolean | disableAnimation | true to disable scroll animation while changing the view; otherwise, false. The default is false. |
Remarks
When AutoFitMode is height or 'DynamicHeight', scroll animation will be disabled by default in android and iOS. If it is called while loading SfListView, then set disableAnimation as true to scroll to appropriate row index, else view doesn't scrolled in android.
Examples
SfListView listView = new SfListView();
int index = listView.DataSource.DisplayItems.IndexOf(viewModel.Customers[2]);
listView.LayoutManager.ScrollToRowIndex(index, true);