Class SfCardView
Represents the SfCardView control that is used to display the content in a card view.
Implements
Inherited Members
Namespace: Syncfusion.Maui.Toolkit.Cards
Assembly: Syncfusion.Maui.Toolkit.dll
Syntax
public class SfCardView : SfContentView, IDrawableLayout, IDrawable, IAbsoluteLayout, ILayout, IView, IElement, ITransform, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, ISafeAreaView, IPadding, ICrossPlatformLayout, IVisualTreeElement, ISemanticsProvider, IPanGestureListener, IGestureListener, IParentThemeElement, IThemeElement
Constructors
SfCardView()
Initializes a new instance of the SfCardView class.
Declaration
public SfCardView()
Fields
BorderColorProperty
Identifies the BorderColor dependency property.
Declaration
public static readonly BindableProperty BorderColorProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for BorderColor dependency property. |
BorderWidthProperty
Identifies the BorderWidth dependency property.
Declaration
public static readonly BindableProperty BorderWidthProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for BorderWidth dependency property. |
CornerRadiusProperty
Identifies the CornerRadius dependency property.
Declaration
public static readonly BindableProperty CornerRadiusProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for CornerRadius dependency property. |
FadeOutOnSwipingProperty
Identifies the FadeOutOnSwiping dependency property.
Declaration
public static readonly BindableProperty FadeOutOnSwipingProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for FadeOutOnSwiping dependency property. |
IndicatorColorProperty
Identifies the IndicatorColor dependency property.
Declaration
public static readonly BindableProperty IndicatorColorProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for IndicatorColor dependency property. |
IndicatorPositionProperty
Identifies the IndicatorPosition dependency property.
Declaration
public static readonly BindableProperty IndicatorPositionProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for IndicatorPosition dependency property. |
IndicatorThicknessProperty
Identifies the IndicatorThickness dependency property.
Declaration
public static readonly BindableProperty IndicatorThicknessProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for IndicatorThickness dependency property. |
IsDismissedProperty
Identifies the IsDismissed dependency property.
Declaration
public static readonly BindableProperty IsDismissedProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for IsDismissed dependency property. |
SwipeToDismissProperty
Identifies the SwipeToDismiss dependency property.
Declaration
public static readonly BindableProperty SwipeToDismissProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for SwipeToDismiss dependency property. |
Properties
BorderColor
Gets or sets the border color of the card view.
Declaration
public Color BorderColor { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Graphics.Color | The default value of BorderColor is "#CAC4D0". |
Examples
The following code demonstrates, how to use the BorderColor property in the card view.
BorderWidth
Gets or sets the border width of the card view.
Declaration
public double BorderWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value of BorderWidth is 1d. |
Examples
The following code demonstrates, how to use the BorderWidth property in the card view.
CornerRadius
Gets or sets the corner radius of the card view.
Declaration
public CornerRadius CornerRadius { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.CornerRadius | The default value of CornerRadius is 5. |
Examples
The following code demonstrates, how to use the CornerRadius property in the card view.
FadeOutOnSwiping
Gets or sets a value indicating whether the card view fade out or not while swiping.
Declaration
public bool FadeOutOnSwiping { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value of FadeOutOnSwiping is true. |
Examples
The following code demonstrates, how to use the FadeOutOnSwiping property in the card view.
IndicatorColor
Gets or sets the indicator color of the card view.
Declaration
public Color IndicatorColor { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Graphics.Color | The default value of IndicatorColor is Transparent. |
Examples
The following code demonstrates, how to use the IndicatorColor property in the card view.
IndicatorPosition
Gets or sets the indicator position of the card view.
Declaration
public CardIndicatorPosition IndicatorPosition { get; set; }
Property Value
Type | Description |
---|---|
CardIndicatorPosition | The default value of IndicatorPosition is CardIndicatorPosition.Left. |
Examples
The following code demonstrates, how to use the IndicatorPosition property in the card view.
IndicatorThickness
Gets or sets the indicator thickness of the card view.
Declaration
public double IndicatorThickness { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value of IndicatorThickness is 0d. |
Examples
The following code demonstrates, how to use the IndicatorThickness property in the card view.
IsDismissed
Gets or sets a value indicating whether the card view is dismissed or not.
Declaration
public bool IsDismissed { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value of IsDismissed is false. |
Examples
The following code demonstrates, how to use the IsDismissed property in the card view.
SwipeToDismiss
Gets or sets a value indicating whether the card view can be dismissed by swiping.
Declaration
public bool SwipeToDismiss { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value of SwipeToDismiss is false. |
Examples
The following code demonstrates, how to use the SwipeToDismiss property in the card view.
Methods
ArrangeContent(Rect)
Method to arrange the content of the card view.
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
MeasureContent(Double, Double)
Method to measure the content of the card view.
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
OnDraw(ICanvas, RectF)
Method to draw the card view.
Declaration
protected override void OnDraw(ICanvas canvas, RectF dirtyRect)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Maui.Graphics.ICanvas | canvas | The draw canvas |
Microsoft.Maui.Graphics.RectF | dirtyRect | The rectangle |
Overrides
Events
Dismissed
Occurs whenever the card view dismissed.
Declaration
public event EventHandler<CardDismissedEventArgs> Dismissed
Event Type
Type |
---|
System.EventHandler<CardDismissedEventArgs> |
Dismissing
Occurs whenever the card view is dismissing.
Declaration
public event EventHandler<CardDismissingEventArgs> Dismissing
Event Type
Type |
---|
System.EventHandler<CardDismissingEventArgs> |