Class SfCardLayout
Represents a class for card layout, which contains card views as children.
Inherited Members
Namespace: Syncfusion.Maui.Toolkit.Cards
Assembly: Syncfusion.Maui.Toolkit.dll
Syntax
public class SfCardLayout : CardLayout, IPanGestureListener, ITapGestureListener, IGestureListener
Constructors
SfCardLayout()
Initializes a new instance of the SfCardLayout class.
Declaration
public SfCardLayout()
Fields
HorizontalCardSpacingProperty
Identifies the HorizontalCardSpacing dependency property.
Declaration
public static readonly BindableProperty HorizontalCardSpacingProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for HorizontalCardSpacing dependency property. |
ShowSwipedCardProperty
Identifies the ShowSwipedCard dependency property.
Declaration
public static readonly BindableProperty ShowSwipedCardProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for ShowSwipedCard dependency property. |
SwipeDirectionProperty
Identifies the SwipeDirection dependency property.
Declaration
public static readonly BindableProperty SwipeDirectionProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for SwipeDirection dependency property. |
VerticalCardSpacingProperty
Identifies the VerticalCardSpacing dependency property.
Declaration
public static readonly BindableProperty VerticalCardSpacingProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for VerticalCardSpacing dependency property. |
VisibleIndexProperty
Identifies the VisibleIndex dependency property.
Declaration
public static readonly BindableProperty VisibleIndexProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for VisibleIndex dependency property. |
Properties
HorizontalCardSpacing
Gets or sets the horizontal spacing between the cards.
Declaration
public int HorizontalCardSpacing { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The default value of HorizontalCardSpacing is 10. |
Examples
The following code demonstrates, how to use the HorizontalCardSpacing property in the card layout.
ShowSwipedCard
Gets or sets a value indicating whether to show the swiped card or not.
Declaration
public bool ShowSwipedCard { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value of ShowSwipedCard is true. |
Examples
The following code demonstrates, how to use the ShowSwipedCard property in the card layout.
SwipeDirection
Gets or sets the swipe direction of the card layout.
Declaration
public CardSwipeDirection SwipeDirection { get; set; }
Property Value
Type | Description |
---|---|
CardSwipeDirection | The default value of SwipeDirection is CardSwipeDirection.Right. |
Examples
The following code demonstrates, how to use the SwipeDirection property in the card layout.
VerticalCardSpacing
Gets or sets the vertical spacing between the cards.
Declaration
public int VerticalCardSpacing { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The default value of VerticalCardSpacing is 10. |
Examples
The following code demonstrates, how to use the VerticalCardSpacing property in the card layout.
VisibleIndex
Gets or sets the visible card index of the card layout.
Declaration
public Nullable<int> VisibleIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Int32> | The default value of VisibleIndex is -1. |
Remarks
If we set the invalid index value, then the card layout will display the last card as visible card.
Examples
The following code demonstrates, how to use the VisibleIndex property in the card layout.
Methods
Backward()
Move to previous card with animation.
Declaration
public void Backward()
Forward()
Move to next card with animation.
Declaration
public void Forward()
Events
Tapped
Occurs whenever the card layout is tapped.
Declaration
public event EventHandler<TappedEventArgs> Tapped
Event Type
Type |
---|
System.EventHandler<Microsoft.Maui.Controls.TappedEventArgs> |
VisibleIndexChanged
Occurs when the card is swiped.
Declaration
public event EventHandler<CardVisibleIndexChangedEventArgs> VisibleIndexChanged
Event Type
Type |
---|
System.EventHandler<CardVisibleIndexChangedEventArgs> |
VisibleIndexChanging
Occurs when the card is swiping.
Declaration
public event EventHandler<CardVisibleIndexChangingEventArgs> VisibleIndexChanging
Event Type
Type |
---|
System.EventHandler<CardVisibleIndexChangingEventArgs> |