Class SfCardLayout
Represents a root class for card layout, which contains card views as children. Based on the SwipeDirection, it is possible to swipe the cards in left or right direction.
Inheritance
Namespace: Syncfusion.XForms.Cards
Assembly: Syncfusion.Cards.XForms.dll
Syntax
public class SfCardLayout : Layout<View>
Examples
<cardLayout:SfCardLayout>
<cardView:SfCardView>
<Label />
</cardView:SfCardView>
<cardView:SfCardView>
<Label />
</cardView:SfCardView>
.....
</cardLayout:SfCardLayout>
Constructors
SfCardLayout()
Declaration
public SfCardLayout()
Fields
CardTappedCommandParameterProperty
Gets or sets a parameter that is sent to the CardTappedCommand.
Declaration
public static readonly BindableProperty CardTappedCommandParameterProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
CardTappedCommandProperty
Gets or sets a value to invoke the tapped event when tap on the card. This is a bindable property.
Declaration
public static readonly BindableProperty CardTappedCommandProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
PaddingProperty
Gets or sets padding around a collection of cards in card layout.
Declaration
public static readonly BindableProperty PaddingProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ShowSwipedCardProperty
Gets or sets a value that indicates whether to show swiped card at the edge.
Declaration
public static readonly BindableProperty ShowSwipedCardProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
SwipeDirectionProperty
Gets or sets a value that indicates whether swiping should be done in the left or right direction. Based on this value, card views will be stacked in opposite direction.
Declaration
public static readonly BindableProperty SwipeDirectionProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
VisibleCardIndexProperty
Gets or sets the index of the card to be displayed in front of the card layout.
Declaration
public static readonly BindableProperty VisibleCardIndexProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Properties
CardTappedCommand
Gets or sets a value to invoke the tapped event when tap on the card.
Declaration
public ICommand CardTappedCommand { get; set; }
Property Value
Type |
---|
System.Windows.Input.ICommand |
CardTappedCommandParameter
Gets or sets a parameter that is sent to the CardTappedCommand.
Declaration
public object CardTappedCommandParameter { get; set; }
Property Value
Type |
---|
System.Object |
Padding
Gets or sets padding around a collection of cards in card layout.
Declaration
public Thickness Padding { get; set; }
Property Value
Type |
---|
Xamarin.Forms.Thickness |
ShowSwipedCard
Gets or sets a value indicating whether to show swiped card at the edge.
Declaration
public bool ShowSwipedCard { get; set; }
Property Value
Type |
---|
System.Boolean |
SwipeDirection
Gets or sets a value that indicates whether swiping should be done in the left or right direction. Based on this value, card views will be arranged in opposite direction.
Declaration
public CardSwipeDirection SwipeDirection { get; set; }
Property Value
Type |
---|
CardSwipeDirection |
VisibleCardIndex
Gets or sets the index of the card to be displayed in front of the card layout.
Declaration
public int VisibleCardIndex { get; set; }
Property Value
Type |
---|
System.Int32 |
Methods
LayoutChildren(Double, Double, Double, Double)
Layouts the children of SfCardLayout.
Declaration
protected override void LayoutChildren(double x, double y, double width, double height)
Parameters
Type | Name | Description |
---|---|---|
System.Double | x | The x coordinate. |
System.Double | y | The y coordinate. |
System.Double | width | Width. |
System.Double | height | Height. |
OnChildAdded(Element)
Overridden. Occurs when a child is added.
Declaration
protected override void OnChildAdded(Element child)
Parameters
Type | Name | Description |
---|---|---|
Xamarin.Forms.Element | child | The SfCardView. |
OnChildRemoved(Element)
Overridden. Occurs when a child has removed.
Declaration
protected override void OnChildRemoved(Element child)
Parameters
Type | Name | Description |
---|---|---|
Xamarin.Forms.Element | child | The SfCardView. |
OnRemoved(View)
Overridden. Occurs when a view is removed.
Declaration
protected override void OnRemoved(View view)
Parameters
Type | Name | Description |
---|---|---|
Xamarin.Forms.View | view | The SfCardView. |
Events
CardTapped
Occurs when the SfCardView is tapped in SfCardLayout.
Declaration
public event EventHandler<TappedEventArgs> CardTapped
Event Type
Type |
---|
System.EventHandler<Xamarin.Forms.TappedEventArgs> |
VisibleCardIndexChanged
Occurs when the SfCardView was swiped in SfCardLayout. The argument contains swiped direction.
Declaration
public event EventHandler<VisibleCardIndexChangedEventArgs> VisibleCardIndexChanged
Event Type
Type |
---|
System.EventHandler<VisibleCardIndexChangedEventArgs> |
VisibleCardIndexChanging
Occurs when the SfCardView is swiping in SfCardLayout. The argument contains swiping direction and cancel the swiping.
Declaration
public event EventHandler<VisibleCardIndexChangingEventArgs> VisibleCardIndexChanging
Event Type
Type |
---|
System.EventHandler<VisibleCardIndexChangingEventArgs> |