Interface ICarousel
Defines the properties and actions for a carousel control interface in the Syncfusion Maui toolkit.
Namespace: Syncfusion.Maui.Toolkit.Carousel
Assembly: Syncfusion.Maui.Toolkit.dll
Syntax
public interface ICarousel : IView, IElement, ITransform
Properties
AllowLoadMore
Gets or sets a value indicating whether the ability to load more items is enabled in the carousel load more.
Declaration
bool AllowLoadMore { get; set; }
Property Value
Type |
---|
System.Boolean |
Duration
Gets or sets the animation duration for item selection transitions in the carousel.
Declaration
int Duration { get; set; }
Property Value
Type |
---|
System.Int32 |
EnableInteraction
Gets or sets a value indicating if users can interact with the carousel, such as swiping.
Declaration
bool EnableInteraction { get; set; }
Property Value
Type |
---|
System.Boolean |
EnableVirtualization
Gets or sets a value that determines whether item virtualization is enabled, which can enhance performance by reusing item templates.
Declaration
bool EnableVirtualization { get; set; }
Property Value
Type |
---|
System.Boolean |
ItemHeight
Gets or sets the height of each carousel item, allowing customization for better visual balance.
Declaration
int ItemHeight { get; set; }
Property Value
Type |
---|
System.Int32 |
ItemSpacing
Gets or sets the spacing between items in the carousel, applicable only in linear view mode.
Declaration
int ItemSpacing { get; set; }
Property Value
Type |
---|
System.Int32 |
ItemsSource
Gets or sets the collection of items displayed by the carousel, allowing each item to have a distinct view.
Declaration
IEnumerable<object> ItemsSource { get; set; }
Property Value
Type |
---|
System.Collections.Generic.IEnumerable<System.Object> |
ItemTemplate
Gets or sets the template used to define the visual appearance of each carousel item.
Declaration
DataTemplate ItemTemplate { get; set; }
Property Value
Type |
---|
Microsoft.Maui.Controls.DataTemplate |
ItemWidth
Gets or sets the width of each carousel item, allowing customization for better alignment.
Declaration
int ItemWidth { get; set; }
Property Value
Type |
---|
System.Int32 |
LoadMoreItemsCount
Gets or sets how many additional items to load when more are requested by the carousel's load more feature.
Declaration
int LoadMoreItemsCount { get; set; }
Property Value
Type |
---|
System.Int32 |
LoadMoreView
Gets or sets a custom view for loading additional items, replacing the default "Load More" notice.
Declaration
View LoadMoreView { get; set; }
Property Value
Type |
---|
Microsoft.Maui.Controls.View |
Offset
Gets or sets the distance between items in the default view, used for spacing them apart.
Declaration
float Offset { get; set; }
Property Value
Type |
---|
System.Single |
RotationAngle
Gets or sets the tilt angle for unselected carousel items in the default view, creating a 3D effect.
Declaration
int RotationAngle { get; set; }
Property Value
Type |
---|
System.Int32 |
ScaleOffset
Gets or sets the scale offset applied to unselected items, differentiating them from the selected item in the default view.
Declaration
float ScaleOffset { get; set; }
Property Value
Type |
---|
System.Single |
SelectedIndex
Gets or sets the index of the currently selected carousel item, which is typically centered in the control.
Declaration
int SelectedIndex { get; set; }
Property Value
Type |
---|
System.Int32 |
SelectedItemOffset
Gets or sets the separation between the selected item and its neighbors in the default view.
Declaration
int SelectedItemOffset { get; set; }
Property Value
Type |
---|
System.Int32 |
SwipeMovementMode
Gets or sets the swipe mode to control how users navigate through items.
Declaration
SwipeMovementMode SwipeMovementMode { get; set; }
Property Value
Type |
---|
SwipeMovementMode |
ViewMode
Gets or sets the layout mode for carousel items, allowing for either a default view or a horizontal stack.
Declaration
ViewMode ViewMode { get; set; }
Property Value
Type |
---|
ViewMode |
Methods
LoadMore()
Initiates the loading of additional items into the carousel.
Declaration
virtual void LoadMore()
MoveNext()
Advances to the next item in the carousel.
Declaration
virtual void MoveNext()
MovePrevious()
Returns to the previous item in the carousel.
Declaration
virtual void MovePrevious()
RaiseSelectionChanged(SelectionChangedEventArgs)
Triggers the event for when the selected item changes.
Declaration
virtual void RaiseSelectionChanged(SelectionChangedEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
SelectionChangedEventArgs | args | The event arguments containing information about the selection change. |
RaiseSwipeEnded(EventArgs)
Triggers the event for when a swipe gesture ends.
Declaration
virtual void RaiseSwipeEnded(EventArgs args)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | args | The event arguments relating to the swipe end. |
RaiseSwipeStarted(SwipeStartedEventArgs)
Triggers the event for the beginning of a swipe gesture.
Declaration
virtual void RaiseSwipeStarted(SwipeStartedEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
SwipeStartedEventArgs | args | The event arguments relating to the swipe start. |