menu

MAUI Toolkit

  • User Guide
  • Demos
  • Support
Class SfCardLayout - MAUI-ToolKit API Reference | Syncfusion

    Show / Hide Table of Contents

    Class SfCardLayout

    Represents a class for card layout, which contains card views as children.

    Inheritance
    System.Object
    CardLayout
    SfCardLayout
    Inherited Members
    CardLayout.CreateLayoutManager()
    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.

    • XAML
    • C#
    <Cards:SfCardLayout x:Name="CardLayout"
                      HorizontalCardSpacing="20">
    </Cards:SfCardLayout>
    CardLayout.HorizontalCardSpacing = 20;

    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.

    • XAML
    • C#
    <Cards:SfCardLayout x:Name="CardLayout"
                      ShowSwipedCard="False">
    </Cards:SfCardLayout>
    CardLayout.ShowSwipedCard = false;

    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.

    • XAML
    • C#
    <Cards:SfCardLayout x:Name="CardLayout"
                      SwipeDirection="Left">
    </Cards:SfCardLayout>
    CardLayout.SwipeDirection = CardSwipeDirection.Left;

    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.

    • XAML
    • C#
    <Cards:SfCardLayout x:Name="CardLayout"
                      VerticalCardSpacing="20">
    </Cards:SfCardLayout>
    CardLayout.VerticalCardSpacing = 20;

    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.

    • XAML
    • C#
    <Cards:SfCardLayout x:Name="CardLayout"
                      VisibleIndex="1">
    </Cards:SfCardLayout>
    CardLayout.VisibleIndex = 1;

    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>
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved