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))]
[TemplateVisualState(Name = "NormalAnimation", GroupName = "ResponsiveStates")]
[TemplateVisualState(Name = "PressedAnimation", GroupName = "ResponsiveStates")]
[TemplateVisualState(Name = "RaisedAnimation", GroupName = "ResponsiveStates")]
[TemplateVisualState(Name = "NormalNoAnimation", GroupName = "ResponsiveStates")]
[TemplateVisualState(Name = "PressedNoAnimation", GroupName = "ResponsiveStates")]
[TemplateVisualState(Name = "RaisedNoAnimation", GroupName = "ResponsiveStates")]
public class Card : Button
- Inheritance:
- object Visual UIElement FrameworkElement Control ContentControl ButtonBase Button object
Constructors
Card()
Initializes an instance of the class.
public Card()
Properties
Badge
A Badge control to adorn the card.
BadgeHorizontalAlignment
The horizontal alignment of the Badge adornment.
public AdornmentHorizontalAlignment BadgeHorizontalAlignment { get; set; }
Property Value
- AdornmentHorizontalAlignment:
The default value is CenterOnTargetRightEdge.
See Also
BadgeHorizontalOffset
The horizontal offset of the Badge adornment.
public double BadgeHorizontalOffset { get; set; }
Property Value
See Also
BadgeVerticalAlignment
The vertical alignment of the Badge adornment.
public AdornmentVerticalAlignment BadgeVerticalAlignment { get; set; }
Property Value
- AdornmentVerticalAlignment:
The default value is CenterOnTargetTopEdge.
See Also
BadgeVerticalOffset
The vertical offset of the Badge adornment.
public double BadgeVerticalOffset { get; set; }
Property Value
See Also
CornerRadius
The CornerRadius applied to the control.
Cover
The content for the cover.
CoverDock
The dock location for the cover.
CoverTemplate
The template used to display the Cover.
CoverTemplateSelector
The DataTemplateSelector to use for the Cover.
Description
The description associated with the card which, by default, may be used to populate the header.
DescriptionStyle
The Style applied to the description.
Footer
The content for the footer.
FooterBackground
The brush used for the background of the footer.
FooterBorderBrush
The brush used for the border of the footer.
FooterBorderThickness
The thickness of the footer border.
FooterForeground
The brush used for the foreground of the footer.
FooterTemplate
The template used to display the Footer.
FooterTemplateSelector
The DataTemplateSelector to use for the Footer.
public DataTemplateSelector? FooterTemplateSelector { get; set; }
Property Value
HasFooterSeparation
Indicates whether there is separation between the footer content area and the content area above it.
HasHeaderContent
Indicates whether Header has a non-null value.
HasHeaderSeparation
Indicates whether there is separation between the header content area and the content area below it.
Header
The content for the header.
HeaderBackground
The brush used for the background of the header.
HeaderBorderBrush
The brush used for the border of the header.
HeaderBorderThickness
The thickness of the header border.
HeaderForeground
The brush used for the foreground of the header.
HeaderTemplate
The template used to display the Header.
HeaderTemplateSelector
The DataTemplateSelector to use for the Header.
public DataTemplateSelector? HeaderTemplateSelector { get; set; }
Property Value
IsAnimationEnabled
Indicates whether animations are enabled for an element, when supported.
IsClickEnabled
Indicates if clicking the card is enabled.
public bool IsClickEnabled { get; set; }
Property Value
Remarks
This property is always true when a Command is assigned to the card.
The default value is false.
IsCoverVisible
Indicates if the cover is visible.
public bool? IsCoverVisible { get; set; }
Property Value
- bool?:
trueto force the cover to be visible,falseto force the cover to be hidden, ornullto show the cover only when cover content is available. The default value isnull.
IsFooterVisible
Indicates if the footer is visible.
public bool? IsFooterVisible { get; set; }
Property Value
- bool?:
trueto force the footer to be visible,falseto force the footer to be hidden, ornullto show the footer only when footer content is available. The default value isnull.
IsHeaderVisible
Indicates if the header is visible.
public bool? IsHeaderVisible { get; set; }
Property Value
- bool?:
trueto force the header to be visible,falseto force the header to be hidden, ornullto show the header only when header content is available. The default value isnull.
IsResponsiveToPointerOver
Indicates if the control should respond to pointer over events.
public bool IsResponsiveToPointerOver { get; set; }
Property Value
- bool:
trueto respond to pointer over events; otherwise,false. The default value isfalse, although the control template may assign a default value.
Remarks
The response to the event, if any, is dictated by the control template.
IsResponsiveToPointerPressed
Indicates if the control should respond to pointer pressed events.
public bool IsResponsiveToPointerPressed { get; set; }
Property Value
- bool:
trueto respond to pointer pressed events; otherwise,false. The default value isfalse, although the control template may assign a default value.
Remarks
The response to the event, if any, is dictated by the control template.
IsShadowEnabled
Indicates whether the shadow can be rendered by the chrome.
public bool IsShadowEnabled { get; set; }
Property Value
- bool:
trueif the shadow can be rendered by the chrome; otherwise,false. The default value istrue.
Remarks
Set this property to false to prevent the shadow from rendering.
IsThumbnailVisible
Indicates if the thumbnail is visible.
public bool? IsThumbnailVisible { get; set; }
Property Value
- bool?:
trueto force the thumbnail to be visible,falseto force the thumbnail to be hidden, ornullto show the thumbnail only when thumbnail content is available. The default value isnull.
ShadowOpacity
The opacity of the shadow.
public double ShadowOpacity { get; set; }
Property Value
- double:
The opacity of the shadow, a value from
0to1. The default value is0.3.
Thumbnail
The content for the thumbnail.
ThumbnailStyle
The Style applied to the thumbnail.
ThumbnailTemplate
The template used to display the Thumbnail.
ThumbnailTemplateSelector
The DataTemplateSelector to use for the Thumbnail.
public DataTemplateSelector? ThumbnailTemplateSelector { get; set; }
Property Value
Title
The title associated with the card which, by default, may be used to populate the header.
TitleStyle
The Style applied to the title.
Methods
DoesPropertyAffectVisualState(DependencyProperty)
Tests if a change in the value for a given property might affects visual state.
protected virtual bool DoesPropertyAffectVisualState(DependencyProperty property)
| Parameter | Type | Description |
|---|---|---|
| property | DependencyProperty | The property to examine. |
Returns
- bool:
trueif a property might affect visual state; otherwise,false.
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.
OnPropertyChanged(DependencyPropertyChangedEventArgs?)
Invoked whenever the effective value of any dependency property on this FrameworkElement has been updated. The specific dependency property that changed is reported in the arguments parameter. Overrides System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs).
protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs? e)
| Parameter | Type | Description |
|---|---|---|
| e | DependencyPropertyChangedEventArgs | The event data that describes the property that changed, as well as old and new values. |
ResolveVisualState()
Returns the name of the current visual state.
ToString()
Returns the string representation of this object.
Fields
BadgeHorizontalAlignmentProperty
Defines the BadgeHorizontalAlignment property.
public static readonly DependencyProperty BadgeHorizontalAlignmentProperty
BadgeHorizontalOffsetProperty
Defines the BadgeHorizontalOffset property.
public static readonly DependencyProperty BadgeHorizontalOffsetProperty
BadgeProperty
Defines the Badge property.
public static readonly DependencyProperty BadgeProperty
BadgeVerticalAlignmentProperty
Defines the BadgeVerticalAlignment property.
public static readonly DependencyProperty BadgeVerticalAlignmentProperty
BadgeVerticalOffsetProperty
Defines the BadgeVerticalOffset property.
public static readonly DependencyProperty BadgeVerticalOffsetProperty
CornerRadiusProperty
Defines the CornerRadius property.
public static readonly DependencyProperty CornerRadiusProperty
CoverDockProperty
Defines the CoverDock property.
public static readonly DependencyProperty CoverDockProperty
CoverProperty
Defines the Cover property.
public static readonly DependencyProperty CoverProperty
CoverTemplateProperty
Defines the CoverTemplate property.
public static readonly DependencyProperty CoverTemplateProperty
CoverTemplateSelectorProperty
Defines the CoverTemplateSelector property.
public static readonly DependencyProperty CoverTemplateSelectorProperty
DescriptionProperty
Defines the Description property.
public static readonly DependencyProperty DescriptionProperty
DescriptionStyleProperty
Defines the DescriptionStyle property.
public static readonly DependencyProperty DescriptionStyleProperty
FooterBackgroundProperty
Defines the FooterBackground property.
public static readonly DependencyProperty FooterBackgroundProperty
FooterBorderBrushProperty
Defines the FooterBorderBrush property.
public static readonly DependencyProperty FooterBorderBrushProperty
FooterBorderThicknessProperty
Defines the FooterBorderThickness property.
public static readonly DependencyProperty FooterBorderThicknessProperty
FooterForegroundProperty
Defines the FooterForeground property.
public static readonly DependencyProperty FooterForegroundProperty
FooterProperty
Defines the Footer property.
public static readonly DependencyProperty FooterProperty
FooterTemplateProperty
Defines the FooterTemplate property.
public static readonly DependencyProperty FooterTemplateProperty
FooterTemplateSelectorProperty
Defines the FooterTemplateSelector property.
public static readonly DependencyProperty FooterTemplateSelectorProperty
HasFooterSeparationProperty
Defines the HasFooterSeparation property.
public static readonly DependencyProperty HasFooterSeparationProperty
HasHeaderContentProperty
Defines the HasHeaderContent property.
public static readonly DependencyProperty HasHeaderContentProperty
HasHeaderSeparationProperty
Defines the HasHeaderSeparation property.
public static readonly DependencyProperty HasHeaderSeparationProperty
HeaderBackgroundProperty
Defines the HeaderBackground property.
public static readonly DependencyProperty HeaderBackgroundProperty
HeaderBorderBrushProperty
Defines the HeaderBorderBrush property.
public static readonly DependencyProperty HeaderBorderBrushProperty
HeaderBorderThicknessProperty
Defines the HeaderBorderThickness property.
public static readonly DependencyProperty HeaderBorderThicknessProperty
HeaderForegroundProperty
Defines the HeaderForeground property.
public static readonly DependencyProperty HeaderForegroundProperty
HeaderProperty
Defines the Header property.
public static readonly DependencyProperty HeaderProperty
HeaderTemplateProperty
Defines the HeaderTemplate property.
public static readonly DependencyProperty HeaderTemplateProperty
HeaderTemplateSelectorProperty
Defines the HeaderTemplateSelector property.
public static readonly DependencyProperty HeaderTemplateSelectorProperty
IsAnimationEnabledProperty
Defines the IsAnimationEnabled property.
public static readonly DependencyProperty IsAnimationEnabledProperty
IsClickEnabledProperty
Defines the IsClickEnabled property.
public static readonly DependencyProperty IsClickEnabledProperty
IsCoverVisibleProperty
Defines the IsCoverVisible property.
public static readonly DependencyProperty IsCoverVisibleProperty
IsFooterVisibleProperty
Defines the IsFooterVisible property.
public static readonly DependencyProperty IsFooterVisibleProperty
IsHeaderVisibleProperty
Defines the IsHeaderVisible property.
public static readonly DependencyProperty IsHeaderVisibleProperty
IsResponsiveToPointerOverProperty
Defines the IsResponsiveToPointerOver property.
public static readonly DependencyProperty IsResponsiveToPointerOverProperty
IsResponsiveToPointerPressedProperty
Defines the IsResponsiveToPointerPressed property.
public static readonly DependencyProperty IsResponsiveToPointerPressedProperty
IsShadowEnabledProperty
Defines the IsShadowEnabled property.
public static readonly DependencyProperty IsShadowEnabledProperty
IsThumbnailVisibleProperty
Defines the IsThumbnailVisible property.
public static readonly DependencyProperty IsThumbnailVisibleProperty
ShadowOpacityProperty
Defines the ShadowOpacity property.
public static readonly DependencyProperty ShadowOpacityProperty
ThumbnailProperty
Defines the Thumbnail property.
public static readonly DependencyProperty ThumbnailProperty
ThumbnailStyleProperty
Defines the ThumbnailStyle property.
public static readonly DependencyProperty ThumbnailStyleProperty
ThumbnailTemplateProperty
Defines the ThumbnailTemplate property.
public static readonly DependencyProperty ThumbnailTemplateProperty
ThumbnailTemplateSelectorProperty
Defines the ThumbnailTemplateSelector property.
public static readonly DependencyProperty ThumbnailTemplateSelectorProperty
TitleProperty
Defines the Title property.
public static readonly DependencyProperty TitleProperty
TitleStyleProperty
Defines the TitleStyle property.
public static readonly DependencyProperty TitleStyleProperty