Class SfCarousel
The SfCarousel class represents a control that allows user navigate through a collection of galleried items.
Inheritance
Namespace: Syncfusion.SfCarousel.XForms
Assembly: Syncfusion.SfCarousel.XForms.dll
Syntax
public class SfCarousel : View, IParentThemeElement, IThemeElement
Constructors
SfCarousel()
Initializes a new instance of the SfCarousel class.
Declaration
public SfCarousel()
Fields
AllowLoadMoreProperty
Identifies the AllowLoadMore bindable property. It indicates whether load more is enabled or not in SfCarousel.
Declaration
public static readonly BindableProperty AllowLoadMoreProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
DataSourceProperty
Identifies the DataSource bindable property. A collection of items that can be populated as Carousel items and get rendered at run-time based on the template provided.
Declaration
public static readonly BindableProperty DataSourceProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
DurationProperty
Identifies the Duration bindable property. This property can be used to give delay on selection animation.
Declaration
public static readonly BindableProperty DurationProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
EnableInteractionProperty
Identifies the EnableInteraction bindable property. It indicates whether this SfCarousel is enbaled or disabled touch interaction.
Declaration
public static readonly BindableProperty EnableInteractionProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
EnableVirtualizationProperty
Identifies the EnableVirtualization bindable property. It indicates whether virtualization is enabled or not in SfCarousel.
Declaration
public static readonly BindableProperty EnableVirtualizationProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ItemHeightProperty
Identifies the ItemHeight bindable property. This property can be used to customize the width of each carousel item.
Declaration
public static readonly BindableProperty ItemHeightProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ItemSpacingProperty
Identifies the ItemSpacing bindable property. This property can be used to apply space between each item. Apply only in linear view mode.
Declaration
public static readonly BindableProperty ItemSpacingProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ItemsSourceProperty
Identifies the ItemsSource bindable property. A collection of type carousel items that can be rendered with different view for each item.
Declaration
public static readonly BindableProperty ItemsSourceProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ItemTemplateProperty
Identifies the ItemTemplate bindable property. An instance of the template class that defines the visual structure of a Carousel item.
Declaration
public static readonly BindableProperty ItemTemplateProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ItemWidthProperty
Identifies the ItemWidth bindable property. This property can be used to customize the width of each carousel item.
Declaration
public static readonly BindableProperty ItemWidthProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
LoadMoreItemsCountProperty
Identifies the LoadMoreItemsCount bindable property. By using the LoadMoreItemsCount property, numerous items can be separated.
Declaration
public static readonly BindableProperty LoadMoreItemsCountProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
LoadMoreViewProperty
Identifies the LoadMoreView bindable property. By using this property, custom view can be passed instead of the LoadMore label.
Declaration
public static readonly BindableProperty LoadMoreViewProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
OffsetProperty
Identifies the Offset bindable property. This property can be used to give space between each item in the Default view mode.
Declaration
public static readonly BindableProperty OffsetProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
RotationAngleProperty
Identifies the RotationAngle bindable property. The angle that tilts the unselected items. Apply only in the Default view mode.
Declaration
public static readonly BindableProperty RotationAngleProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ScaleOffsetProperty
Identifies the ScaleOffset bindable property. It is a scaling ratio to differentiate unselected items in the Default view mode.
Declaration
public static readonly BindableProperty ScaleOffsetProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
SelectedIndexProperty
Identifies the SelectedIndex bindable property. The item to be in a selected state and to be the center item of the control among user inputs.
Declaration
public static readonly BindableProperty SelectedIndexProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
SelectedItemOffsetProperty
Identifies the SelectedItemOffset bindable property. It gives space between the selected and unselected items in the Default view mode.
Declaration
public static readonly BindableProperty SelectedItemOffsetProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ViewModeProperty
Identifies the ViewMode bindable property. The mode used to arrange the items as default 3-D view or in a horizontal stacked layout.
Declaration
public static readonly BindableProperty ViewModeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Properties
AllowLoadMore
Gets or sets a value indicating whether this SfCarousel allow load more.
Declaration
public bool AllowLoadMore { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
DataSource
Gets or sets a collection of items that can be populated as Carousel Items and get rendered at run-time based on the Template provided.
Declaration
public IEnumerable<object> DataSource { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Object> | The default value is null. |
Duration
Gets or sets the value of Duration. This property can be used to give delay on selection animation.
Declaration
public int Duration { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The default value is 600. |
EnableInteraction
Gets or sets a value indicating whether the it's allow interaction.
Declaration
public bool EnableInteraction { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
EnableVirtualization
Gets or sets a value indicating whether enbale virtualization or not.
Declaration
public bool EnableVirtualization { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
ItemHeight
Gets or sets the value of the ItemHeight. This property can be used to customize the height of each carousel item.
Declaration
public int ItemHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The default value is 500. |
ItemSpacing
Gets or sets the value of the ItemSpacing. This property can be used to apply space between each item. Apply only in linear view mode.
Declaration
public int ItemSpacing { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The default value is 5. |
ItemsSource
Gets or sets a collection of type carousel items that can be rendered with different view for each item.
Declaration
public IEnumerable<object> ItemsSource { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Object> | Default value is null. |
ItemTemplate
Gets or sets an instance of the Template class that defines the visual structure of a Carousel item.
Declaration
public DataTemplate ItemTemplate { get; set; }
Property Value
Type | Description |
---|---|
Xamarin.Forms.DataTemplate | The default value is null. |
ItemWidth
Gets or sets the value of ItemWidth. This property can be used to customize the width of each carousel item.
Declaration
public int ItemWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The default value is 350. |
LoadMoreItemsCount
Gets or sets the value of LoadMoreItemsCount. By using the LoadMoreItemsCount property, numerous items can be separated.
Declaration
public int LoadMoreItemsCount { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The default value is 3. |
LoadMoreView
Gets or sets the value of the LoadMoreView. By using this property, custom view can be passed instead of the LoadMore label.
Declaration
public View LoadMoreView { get; set; }
Property Value
Type | Description |
---|---|
Xamarin.Forms.View | The default value is null. |
Offset
Gets or sets the value of Offset. This property can be used to give the space between each item in the Default view mode.
Declaration
public float Offset { get; set; }
Property Value
Type | Description |
---|---|
System.Single | The default value is 60. |
RotationAngle
Gets or sets the value of RotationAngle. It is an angle that tilts the unselected items. Apply only in the Default view mode.
Declaration
public int RotationAngle { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The default value is 45. |
ScaleOffset
Gets or sets the value of Offset. It is a scaling ratio to differentiate unselected items in the Default view mode.
Declaration
public float ScaleOffset { get; set; }
Property Value
Type | Description |
---|---|
System.Single | The default value is 0.7f. |
SelectedIndex
Gets or sets the item to be in a selected state and to be the center item of the control among the user input.
Declaration
public int SelectedIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The default value is 0. |
SelectedItemOffset
Gets or sets the value of SelectedItemOffset. It gives space between the selected and unselected items in the Default view mode.
Declaration
public int SelectedItemOffset { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The default value is 60. |
ViewMode
Gets or sets the mode used to arrange the items as default 3D view or in a horizontal stacked layout.
Declaration
public ViewMode ViewMode { get; set; }
Property Value
Type | Description |
---|---|
ViewMode | The default value of viewmode is "Default". |
Methods
add_SelectionChanged(SfCarousel.SelectionChangedEventHandler)
Declaration
public void add_SelectionChanged(SfCarousel.SelectionChangedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
SfCarousel.SelectionChangedEventHandler | value |
LoadMore()
LoadMore method.
Declaration
public void LoadMore()
MoveNext()
Moves item from the right to left, in turn it increments the Selected index of control by one.
Declaration
public void MoveNext()
MovePrevious()
Moves item from the left to right, in turn it decrements the Selected index of control by one.
Declaration
public void MovePrevious()
OnSizeRequest(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 OnSizeRequest(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 | The return value. |
remove_SelectionChanged(SfCarousel.SelectionChangedEventHandler)
Declaration
public void remove_SelectionChanged(SfCarousel.SelectionChangedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
SfCarousel.SelectionChangedEventHandler | value |
Events
SelectionChanged
Occurs when users select an item from unselected items in SfCarousel.
Declaration
public event SfCarousel.SelectionChangedEventHandler SelectionChanged
Event Type
Type |
---|
SfCarousel.SelectionChangedEventHandler |
SwipeEnded
Occurs when swipe ended in SfCarousel.
Declaration
public event EventHandler<EventArgs> SwipeEnded
Event Type
Type |
---|
System.EventHandler<System.EventArgs> |
SwipeStarted
Occurs when users select an item to swipe SfCarousel.
Declaration
public event EventHandler<SwipeStartedEventArgs> SwipeStarted
Event Type
Type |
---|
System.EventHandler<SwipeStartedEventArgs> |