Class SfCardLayout
Represents a class for card layout, which contains card views as children.
Implements
Inherited Members
Namespace: Syncfusion.Maui.Cards
Assembly: Syncfusion.Maui.Cards.dll
Syntax
public class SfCardLayout : SfView, IDrawableLayout, IDrawable, IAbsoluteLayout, ILayout, IView, IElement, ITransform, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, ISafeAreaView, IPadding, ICrossPlatformLayout, IVisualTreeElement, ISemanticsProvider, 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 |
---|
System.Int32 |
ShowSwipedCard
Gets or sets a value indicating whether to show the swiped card or not.
Declaration
public bool ShowSwipedCard { get; set; }
Property Value
Type |
---|
System.Boolean |
SwipeDirection
Gets or sets the swipe direction of the card layout.
Declaration
public CardSwipeDirection SwipeDirection { get; set; }
Property Value
Type |
---|
CardSwipeDirection |
VerticalCardSpacing
Gets or sets the vertical spacing between the cards.
Declaration
public int VerticalCardSpacing { get; set; }
Property Value
Type |
---|
System.Int32 |
VisibleIndex
Gets or sets the visible card index of the card layout.
Declaration
public Nullable<int> VisibleIndex { get; set; }
Property Value
Type |
---|
System.Nullable<System.Int32> |
Remarks
If we set the invalid index value, then the card layout will display the last card as visible card.
Methods
ArrangeContent(Rect)
Method to arrange the content of the card layout.
Declaration
protected override Size ArrangeContent(Rect bounds)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Maui.Graphics.Rect | bounds | The available size |
Returns
Type | Description |
---|---|
Microsoft.Maui.Graphics.Size | The actual size |
Overrides
Backward()
Move to previous card with animation.
Declaration
public void Backward()
Forward()
Move to next card with animation.
Declaration
public void Forward()
MeasureContent(Double, Double)
Method to measure the content of the card layout.
Declaration
protected override Size MeasureContent(double widthConstraint, double heightConstraint)
Parameters
Type | Name | Description |
---|---|---|
System.Double | widthConstraint | The available width |
System.Double | heightConstraint | The available height |
Returns
Type | Description |
---|---|
Microsoft.Maui.Graphics.Size | The actual size |
Overrides
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> |