In This Article

Card Class

A container to group related information for a single subject.

[TemplatePart(Name = "PART_ContentPresenter", Type = typeof(ContentPresenter))]
[TemplatePart(Name = "PART_CoverPresenter", Type = typeof(ContentPresenter))]
[TemplatePart(Name = "PART_FooterPresenter", Type = typeof(ContentPresenter))]
[TemplatePart(Name = "PART_HeaderPresenter", Type = typeof(ContentPresenter))]
[TemplatePart(Name = "PART_ThumbnailPresenter", Type = typeof(ContentPresenter))]
public class Card : Button
Inheritance:
object Visual UIElement FrameworkElement Control ContentControl ButtonBase Button object

Constructors

Card()

Initializes a new instance of the class.

public Card()

Properties

Badge

Gets or sets a Badge control to adorn the card.

public Badge Badge { get; set; }

Property Value

Badge:

A Badge.

See Also

BadgeHorizontalAlignment

Gets or sets the horizontal alignment of the Badge adornment.

public AdornmentHorizontalAlignment BadgeHorizontalAlignment { get; set; }

Property Value

AdornmentHorizontalAlignment:

An AdornmentHorizontalAlignment.

See Also

BadgeHorizontalOffset

Gets or sets the horizontal offset of the Badge adornment.

public double BadgeHorizontalOffset { get; set; }

Property Value

double:

A double value.

See Also

BadgeVerticalAlignment

Gets or sets the vertical alignment of the Badge adornment.

public AdornmentVerticalAlignment BadgeVerticalAlignment { get; set; }

Property Value

AdornmentVerticalAlignment:

An AdornmentVerticalAlignment.

See Also

BadgeVerticalOffset

Gets or sets the vertical offset of the Badge adornment.

public double BadgeVerticalOffset { get; set; }

Property Value

double:

A double value.

See Also

CornerRadius

Gets or sets the CornerRadius applied to the control.

public CornerRadius CornerRadius { get; set; }

Property Value

CornerRadius:

A CornerRadius.

Cover

Gets or sets the content for the cover.

public object? Cover { get; set; }

Property Value

object

CoverDock

Gets or sets the dock location for the cover.

public Dock CoverDock { get; set; }

Property Value

Dock

CoverTemplate

Gets or sets the template used to display the Cover.

public DataTemplate CoverTemplate { get; set; }

Property Value

DataTemplate

CoverTemplateSelector

Gets or sets the DataTemplateSelector to use for the Cover.

public DataTemplateSelector CoverTemplateSelector { get; set; }

Property Value

DataTemplateSelector:

The DataTemplateSelector to use for the Cover.

Description

Gets or sets the description associated with the card which, by default, may be used to populate the header.

public string? Description { get; set; }

Property Value

string

DescriptionStyle

Gets or sets the Style applied to the description.

public Style DescriptionStyle { get; set; }

Property Value

Style

Gets or sets the content for the footer.

public object? Footer { get; set; }

Property Value

object

FooterBackground

Gets or sets the brush used for the background of the footer.

public Brush FooterBackground { get; set; }

Property Value

Brush

FooterBorderBrush

Gets or sets the brush used for the border of the footer.

public Brush FooterBorderBrush { get; set; }

Property Value

Brush

FooterBorderThickness

Gets or sets the thickness of footer border.

public Thickness FooterBorderThickness { get; set; }

Property Value

Thickness

FooterForeground

Gets or sets the brush used for the foreground of the footer.

public Brush FooterForeground { get; set; }

Property Value

Brush

FooterTemplate

Gets or sets the template used to display the Footer.

public DataTemplate FooterTemplate { get; set; }

Property Value

DataTemplate

FooterTemplateSelector

Gets or sets the DataTemplateSelector to use for the Footer.

public DataTemplateSelector FooterTemplateSelector { get; set; }

Property Value

DataTemplateSelector:

The DataTemplateSelector to use for the Footer.

HasFooterSeparation

Indicates whether there is separation between the footer content area and the content area above it.

public bool HasFooterSeparation { get; }

Property Value

bool

HasHeaderContent

Indicates whether Header has a non-null value.

public bool HasHeaderContent { get; }

Property Value

bool

HasHeaderSeparation

Indicates whether there is separation between the header content area and the content area below it.

public bool HasHeaderSeparation { get; }

Property Value

bool

Header

Gets or sets the content for the header.

public object? Header { get; set; }

Property Value

object

HeaderBackground

Gets or sets the brush used for the background of the header.

public Brush HeaderBackground { get; set; }

Property Value

Brush

HeaderBorderBrush

Gets or sets the brush used for the border of the header.

public Brush HeaderBorderBrush { get; set; }

Property Value

Brush

HeaderBorderThickness

Gets or The thickness of header border.

public Thickness HeaderBorderThickness { get; set; }

Property Value

Thickness

HeaderForeground

Gets or sets the brush used for the foreground of the header.

public Brush HeaderForeground { get; set; }

Property Value

Brush

HeaderTemplate

Gets or sets the template used to display the Header.

public DataTemplate HeaderTemplate { get; set; }

Property Value

DataTemplate

HeaderTemplateSelector

Gets or sets the DataTemplateSelector to use for the Header.

public DataTemplateSelector HeaderTemplateSelector { get; set; }

Property Value

DataTemplateSelector:

The DataTemplateSelector to use for the Header.

IsAnimationEnabled

Gets or sets whether animations are enabled for an element, when supported.

public bool IsAnimationEnabled { get; set; }

Property Value

bool:

true if animations are enabled; otherwise, false. The default value is true.

IsClickEnabled

Gets or sets if clicking the card is enabled.

public bool IsClickEnabled { get; set; }

Property Value

bool

Remarks

This property is always true when a Command is assigned to the card. The default value is false.

IsCoverVisible

Gets or sets if the cover is visible.

public bool? IsCoverVisible { get; set; }

Property Value

bool?:

true to force the cover to be visible, false to force the cover to be hidden, or null to show the cover only when cover content is available. The default value is null.

IsFooterVisible

Gets or sets if the footer is visible.

public bool? IsFooterVisible { get; set; }

Property Value

bool?:

true to force the footer to be visible, false to force the footer to be hidden, or null to show the footer only when footer content is available. The default value is null.

IsHeaderVisible

Gets or sets if the header is visible.

public bool? IsHeaderVisible { get; set; }

Property Value

bool?:

true to force the header to be visible, false to force the header to be hidden, or null to show the header only when header content is available. The default value is null.

IsShadowEnabled

Gets or sets whether the shadow can be rendered by the chrome.

public bool IsShadowEnabled { get; set; }

Property Value

bool:

true if the shadow can be rendered by the chrome; otherwise, false. The default value is true.

Remarks

Set this property to false to prevent the shadow from rendering.

IsThumbnailVisible

Gets or sets if the thumbnail is visible.

public bool? IsThumbnailVisible { get; set; }

Property Value

bool?:

true to force the thumbnail to be visible, false to force the thumbnail to be hidden, or null to show the thumbnail only when thumbnail content is available. The default value is null.

ShadowOpacity

Gets or sets the opacity of the shadow.

public double ShadowOpacity { get; set; }

Property Value

double:

The opacity of the shadow, a value from 0 to 1. The default value is 0.3.

Thumbnail

Gets or sets the content for the thumbnail.

public object? Thumbnail { get; set; }

Property Value

object

ThumbnailStyle

Gets or sets the Style applied to the thumbnail.

public Style ThumbnailStyle { get; set; }

Property Value

Style

ThumbnailTemplate

Gets or sets the template used to display the Thumbnail.

public DataTemplate ThumbnailTemplate { get; set; }

Property Value

DataTemplate

ThumbnailTemplateSelector

Gets or sets the DataTemplateSelector to use for the Thumbnail.

public DataTemplateSelector ThumbnailTemplateSelector { get; set; }

Property Value

DataTemplateSelector:

The DataTemplateSelector to use for the Thumbnail.

Title

Gets or sets the title associated with the card which, by default, may be used to populate the header.

public string? Title { get; set; }

Property Value

string

TitleStyle

Gets or sets the Style applied to the title.

public Style TitleStyle { get; set; }

Property Value

Style

Methods

OnApplyTemplate()

When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().

public override void OnApplyTemplate()

OnClick()

Called when a Button is clicked.

protected override void OnClick()

OnCreateAutomationPeer()

Creates an appropriate ButtonAutomationPeer for this control as part of the WPF infrastructure.

protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer:

A ButtonAutomationPeer for this control.

ToString()

Returns the string representation of this object.

public override string ToString()

Returns

string:

The string representation of this object.

Fields

BadgeHorizontalAlignmentProperty

Identifies the BadgeHorizontalAlignment dependency property.

public static readonly DependencyProperty BadgeHorizontalAlignmentProperty

BadgeHorizontalOffsetProperty

Identifies the BadgeHorizontalOffset dependency property.

public static readonly DependencyProperty BadgeHorizontalOffsetProperty

BadgeProperty

Identifies the Badge dependency property.

public static readonly DependencyProperty BadgeProperty

BadgeVerticalAlignmentProperty

Identifies the BadgeVerticalAlignment dependency property.

public static readonly DependencyProperty BadgeVerticalAlignmentProperty

BadgeVerticalOffsetProperty

Identifies the BadgeVerticalOffset dependency property.

public static readonly DependencyProperty BadgeVerticalOffsetProperty

CornerRadiusProperty

Identifies the CornerRadius dependency property.

public static readonly DependencyProperty CornerRadiusProperty

CoverDockProperty

Identifies the CoverDock dependency property.

public static readonly DependencyProperty CoverDockProperty

CoverProperty

Identifies the Cover dependency property.

public static readonly DependencyProperty CoverProperty

CoverTemplateProperty

Identifies the CoverTemplate dependency property.

public static readonly DependencyProperty CoverTemplateProperty

CoverTemplateSelectorProperty

Identifies the CoverTemplateSelector dependency property.

public static readonly DependencyProperty CoverTemplateSelectorProperty

DescriptionProperty

Identifies the Description dependency property.

public static readonly DependencyProperty DescriptionProperty

DescriptionStyleProperty

Identifies the DescriptionStyle dependency property.

public static readonly DependencyProperty DescriptionStyleProperty

FooterBackgroundProperty

Identifies the FooterBackground dependency property.

public static readonly DependencyProperty FooterBackgroundProperty

FooterBorderBrushProperty

Identifies the FooterBorderBrush dependency property.

public static readonly DependencyProperty FooterBorderBrushProperty

FooterBorderThicknessProperty

Identifies the FooterBorderThickness dependency property.

public static readonly DependencyProperty FooterBorderThicknessProperty

FooterForegroundProperty

Identifies the FooterForeground dependency property.

public static readonly DependencyProperty FooterForegroundProperty

FooterProperty

Identifies the Footer dependency property.

public static readonly DependencyProperty FooterProperty

FooterTemplateProperty

Identifies the FooterTemplate dependency property.

public static readonly DependencyProperty FooterTemplateProperty

FooterTemplateSelectorProperty

Identifies the FooterTemplateSelector dependency property.

public static readonly DependencyProperty FooterTemplateSelectorProperty

HasFooterSeparationProperty

Identifies the read-only HasFooterSeparation dependency property.

public static readonly DependencyProperty HasFooterSeparationProperty

HasHeaderContentProperty

Identifies the read-only HasHeaderContent dependency property.

public static readonly DependencyProperty HasHeaderContentProperty

HasHeaderSeparationProperty

Identifies the read-only HasHeaderSeparation dependency property.

public static readonly DependencyProperty HasHeaderSeparationProperty

HeaderBackgroundProperty

Identifies the HeaderBackground dependency property.

public static readonly DependencyProperty HeaderBackgroundProperty

HeaderBorderBrushProperty

Identifies the HeaderBorderBrush dependency property.

public static readonly DependencyProperty HeaderBorderBrushProperty

HeaderBorderThicknessProperty

Identifies the HeaderBorderThickness dependency property.

public static readonly DependencyProperty HeaderBorderThicknessProperty

HeaderForegroundProperty

Identifies the HeaderForeground dependency property.

public static readonly DependencyProperty HeaderForegroundProperty

HeaderProperty

Identifies the Header dependency property.

public static readonly DependencyProperty HeaderProperty

HeaderTemplateProperty

Identifies the HeaderTemplate dependency property.

public static readonly DependencyProperty HeaderTemplateProperty

HeaderTemplateSelectorProperty

Identifies the HeaderTemplateSelector dependency property.

public static readonly DependencyProperty HeaderTemplateSelectorProperty

IsAnimationEnabledProperty

Identifies the IsAnimationEnabled dependency property.

public static readonly DependencyProperty IsAnimationEnabledProperty

IsClickEnabledProperty

Identifies the IsClickEnabled depedency property.

public static readonly DependencyProperty IsClickEnabledProperty

IsCoverVisibleProperty

Identifies the IsCoverVisible dependency property.

public static readonly DependencyProperty IsCoverVisibleProperty

IsFooterVisibleProperty

Identifies the IsFooterVisible dependency property.

public static readonly DependencyProperty IsFooterVisibleProperty

IsHeaderVisibleProperty

Identifies the IsHeaderVisible dependency property.

public static readonly DependencyProperty IsHeaderVisibleProperty

IsShadowEnabledProperty

Identifies the IsShadowEnabled dependency property.

public static readonly DependencyProperty IsShadowEnabledProperty

IsThumbnailVisibleProperty

Identifies the IsThumbnailVisible dependency property.

public static readonly DependencyProperty IsThumbnailVisibleProperty

ShadowOpacityProperty

Identifies the ShadowOpacity dependency property.

public static readonly DependencyProperty ShadowOpacityProperty

ThumbnailProperty

Identifies the Thumbnail dependency property.

public static readonly DependencyProperty ThumbnailProperty

ThumbnailStyleProperty

Identifies the ThumbnailStyle dependency property.

public static readonly DependencyProperty ThumbnailStyleProperty

ThumbnailTemplateProperty

Identifies the ThumbnailTemplate dependency property.

public static readonly DependencyProperty ThumbnailTemplateProperty

ThumbnailTemplateSelectorProperty

Identifies the ThumbnailTemplateSelector dependency property.

public static readonly DependencyProperty ThumbnailTemplateSelectorProperty

TitleProperty

Identifies the Title dependency property.

public static readonly DependencyProperty TitleProperty

TitleStyleProperty

Identifies the TitleStyle dependency property.

public static readonly DependencyProperty TitleStyleProperty