In This Article

SettingsCard Class

Displays a setting within a card.

[TemplatePart(Name = "PART_ActionIconPresenter", Type = typeof(ContentPresenter))]
[TemplatePart(Name = "PART_ContentPresenter", Type = typeof(ContentPresenter))]
[TemplatePart(Name = "PART_DescriptionPresenter", Type = typeof(ContentPresenter))]
[TemplatePart(Name = "PART_HeaderPresenter", Type = typeof(ContentPresenter))]
[TemplatePart(Name = "PART_HeaderIconPresenter", Type = typeof(ContentPresenter))]
public class SettingsCard : Button
Inheritance:
object Visual UIElement FrameworkElement Control ContentControl ButtonBase Button object

Constructors

SettingsCard()

Initializes an instance of the class.

public SettingsCard()

Properties

ActionIcon

The content for the action icon.

public object? ActionIcon { get; set; }

Property Value

object

ActionIconTemplate

The template used to display the ActionIcon.

public DataTemplate? ActionIconTemplate { get; set; }

Property Value

DataTemplate

ActionIconTemplateSelector

public DataTemplateSelector? ActionIconTemplateSelector { get; set; }

Property Value

DataTemplateSelector

CornerRadius

The corner radius of the element.

public CornerRadius CornerRadius { get; set; }

Property Value

CornerRadius

Description

The setting description.

public object? Description { get; set; }

Property Value

object

DescriptionTemplate

The template used to display the Description.

public DataTemplate? DescriptionTemplate { get; set; }

Property Value

DataTemplate

DescriptionTemplateSelector

public DataTemplateSelector? DescriptionTemplateSelector { get; set; }

Property Value

DataTemplateSelector

Header

The content for the header.

public object? Header { get; set; }

Property Value

object

HeaderIcon

The content for the header icon.

public object? HeaderIcon { get; set; }

Property Value

object

HeaderIconTemplate

The template used to display the HeaderIcon.

public DataTemplate? HeaderIconTemplate { get; set; }

Property Value

DataTemplate

HeaderIconTemplateSelector

public DataTemplateSelector? HeaderIconTemplateSelector { get; set; }

Property Value

DataTemplateSelector

HeaderTemplate

The template used to display the Header.

public DataTemplate? HeaderTemplate { get; set; }

Property Value

DataTemplate

HeaderTemplateSelector

The DataTemplateSelector to use for Header.

public DataTemplateSelector? HeaderTemplateSelector { get; set; }

Property Value

DataTemplateSelector

IsActionIconVisible

Indicates if the action icon is visible.

public bool? IsActionIconVisible { get; set; }

Property Value

bool?:

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

IsClickEnabled

Indicates 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.

IsDescriptionVisible

Indicates if the description is visible.

public bool? IsDescriptionVisible { get; set; }

Property Value

bool?:

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

IsHeaderIconVisible

Indicates if the header icon is visible.

public bool? IsHeaderIconVisible { get; set; }

Property Value

bool?:

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

IsHeaderVisible

Indicates 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.

IsWrapped

Indicates if the content is wrapped.

public bool? IsWrapped { get; set; }

Property Value

bool?:

true to force the content to be wrapped, false to prevent the content from being wrapped, null to wrap the content only when the card's width is below a certain threshold. The default value is null.

WrapThreshold

The width threshold at which the card will be wrapped.

public double WrapThreshold { get; set; }

Property Value

double

Remarks

The card will be wrapped when the width is less than or equal to the configured threshold.

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.

OnKeyDown(KeyEventArgs)

Provides class handling for the KeyDown routed event that occurs when the user presses a key while this control has focus.

protected override void OnKeyDown(KeyEventArgs e)
Parameter Type Description
e KeyEventArgs

The event data.

OnKeyUp(KeyEventArgs)

Provides class handling for the KeyUp routed event that occurs when the user releases a key while this control has focus.

protected override void OnKeyUp(KeyEventArgs e)
Parameter Type Description
e KeyEventArgs

The event data for the KeyUp event.

OnRenderSizeChanged(SizeChangedInfo)

Called when the rendered size of a control changes.

protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
Parameter Type Description
sizeInfo SizeChangedInfo

Specifies the size changes.

ToString()

Returns the string representation of this object.

public override string ToString()

Returns

string:

The string representation of this object.

Fields

ActionIconProperty

Defines the ActionIcon property.

public static readonly DependencyProperty ActionIconProperty

ActionIconTemplateProperty

Defines the ActionIconTemplate property.

public static readonly DependencyProperty ActionIconTemplateProperty

ActionIconTemplateSelectorProperty

Defines the ActionIconTemplateSelector property.

public static readonly DependencyProperty ActionIconTemplateSelectorProperty

CornerRadiusProperty

Defines the CornerRadius property.

public static readonly DependencyProperty CornerRadiusProperty

DescriptionProperty

Defines the Description property.

public static readonly DependencyProperty DescriptionProperty

DescriptionTemplateProperty

Defines the DescriptionTemplate property.

public static readonly DependencyProperty DescriptionTemplateProperty

DescriptionTemplateSelectorProperty

Defines the DescriptionTemplateSelector property.

public static readonly DependencyProperty DescriptionTemplateSelectorProperty

HeaderIconProperty

Defines the HeaderIcon property.

public static readonly DependencyProperty HeaderIconProperty

HeaderIconTemplateProperty

Defines the HeaderIconTemplate property.

public static readonly DependencyProperty HeaderIconTemplateProperty

HeaderIconTemplateSelectorProperty

Defines the HeaderIconTemplateSelector property.

public static readonly DependencyProperty HeaderIconTemplateSelectorProperty

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

IsActionIconVisibleProperty

Defines the IsActionIconVisible property.

public static readonly DependencyProperty IsActionIconVisibleProperty

IsClickEnabledProperty

Defines the IsClickEnabled property.

public static readonly DependencyProperty IsClickEnabledProperty

IsDescriptionVisibleProperty

Defines the IsDescriptionVisible property.

public static readonly DependencyProperty IsDescriptionVisibleProperty

IsHeaderIconVisibleProperty

Defines the IsHeaderIconVisible property.

public static readonly DependencyProperty IsHeaderIconVisibleProperty

IsHeaderVisibleProperty

Defines the IsHeaderVisible property.

public static readonly DependencyProperty IsHeaderVisibleProperty

IsWrappedProperty

Defines the IsWrapped property.

public static readonly DependencyProperty IsWrappedProperty

WrapThresholdProperty

Defines the WrapThreshold property.

public static readonly DependencyProperty WrapThresholdProperty

Extension Methods