SettingsCard Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
This is the base control to create consistent settings experiences, inline with the Windows 11 design language. A SettingsCard can also be hosted within a SettingsExpander.
[Microsoft.UI.Xaml.TemplatePart(Name="PART_ActionIconPresenterHolder", Type=typeof(Microsoft.UI.Xaml.Controls.Viewbox))]
[Microsoft.UI.Xaml.TemplatePart(Name="PART_HeaderPresenter", Type=typeof(Microsoft.UI.Xaml.Controls.ContentPresenter))]
[Microsoft.UI.Xaml.TemplatePart(Name="PART_DescriptionPresenter", Type=typeof(Microsoft.UI.Xaml.Controls.ContentPresenter))]
[Microsoft.UI.Xaml.TemplatePart(Name="PART_HeaderIconPresenterHolder", Type=typeof(Microsoft.UI.Xaml.Controls.Viewbox))]
[Microsoft.UI.Xaml.TemplateVisualState(GroupName="CommonStates", Name="Normal")]
[Microsoft.UI.Xaml.TemplateVisualState(GroupName="CommonStates", Name="PointerOver")]
[Microsoft.UI.Xaml.TemplateVisualState(GroupName="CommonStates", Name="Pressed")]
[Microsoft.UI.Xaml.TemplateVisualState(GroupName="CommonStates", Name="Disabled")]
[Microsoft.UI.Xaml.TemplateVisualState(GroupName="ContentAlignmentStates", Name="Right")]
[Microsoft.UI.Xaml.TemplateVisualState(GroupName="ContentAlignmentStates", Name="RightWrapped")]
[Microsoft.UI.Xaml.TemplateVisualState(GroupName="ContentAlignmentStates", Name="RightWrappedNoIcon")]
[Microsoft.UI.Xaml.TemplateVisualState(GroupName="ContentAlignmentStates", Name="Left")]
[Microsoft.UI.Xaml.TemplateVisualState(GroupName="ContentAlignmentStates", Name="Vertical")]
[Microsoft.UI.Xaml.TemplateVisualState(GroupName="ContentSpacingStates", Name="NoContentSpacing")]
[Microsoft.UI.Xaml.TemplateVisualState(GroupName="ContentSpacingStates", Name="ContentSpacing")]
public class SettingsCard : Microsoft.UI.Xaml.Controls.Primitives.ButtonBase
[<Microsoft.UI.Xaml.TemplatePart(Name="PART_ActionIconPresenterHolder", Type=typeof(Microsoft.UI.Xaml.Controls.Viewbox))>]
[<Microsoft.UI.Xaml.TemplatePart(Name="PART_HeaderPresenter", Type=typeof(Microsoft.UI.Xaml.Controls.ContentPresenter))>]
[<Microsoft.UI.Xaml.TemplatePart(Name="PART_DescriptionPresenter", Type=typeof(Microsoft.UI.Xaml.Controls.ContentPresenter))>]
[<Microsoft.UI.Xaml.TemplatePart(Name="PART_HeaderIconPresenterHolder", Type=typeof(Microsoft.UI.Xaml.Controls.Viewbox))>]
[<Microsoft.UI.Xaml.TemplateVisualState(GroupName="CommonStates", Name="Normal")>]
[<Microsoft.UI.Xaml.TemplateVisualState(GroupName="CommonStates", Name="PointerOver")>]
[<Microsoft.UI.Xaml.TemplateVisualState(GroupName="CommonStates", Name="Pressed")>]
[<Microsoft.UI.Xaml.TemplateVisualState(GroupName="CommonStates", Name="Disabled")>]
[<Microsoft.UI.Xaml.TemplateVisualState(GroupName="ContentAlignmentStates", Name="Right")>]
[<Microsoft.UI.Xaml.TemplateVisualState(GroupName="ContentAlignmentStates", Name="RightWrapped")>]
[<Microsoft.UI.Xaml.TemplateVisualState(GroupName="ContentAlignmentStates", Name="RightWrappedNoIcon")>]
[<Microsoft.UI.Xaml.TemplateVisualState(GroupName="ContentAlignmentStates", Name="Left")>]
[<Microsoft.UI.Xaml.TemplateVisualState(GroupName="ContentAlignmentStates", Name="Vertical")>]
[<Microsoft.UI.Xaml.TemplateVisualState(GroupName="ContentSpacingStates", Name="NoContentSpacing")>]
[<Microsoft.UI.Xaml.TemplateVisualState(GroupName="ContentSpacingStates", Name="ContentSpacing")>]
type SettingsCard = class
inherit ButtonBase
Public Class SettingsCard
Inherits ButtonBase
- Inheritance
-
Microsoft.UI.Xaml.Controls.Primitives.ButtonBaseSettingsCard
- Attributes
-
Microsoft.UI.Xaml.TemplatePartAttribute Microsoft.UI.Xaml.TemplateVisualStateAttribute
Constructors
| Name | Description |
|---|---|
| SettingsCard() |
Creates a new instance of the SettingsCard class. |
Fields
| Name | Description |
|---|---|
| ActionIconProperty |
The backing Microsoft.UI.Xaml.DependencyProperty for the ActionIcon property. |
| ActionIconToolTipProperty |
The backing Microsoft.UI.Xaml.DependencyProperty for the ActionIconToolTip property. |
| ContentAlignmentProperty |
The backing Microsoft.UI.Xaml.DependencyProperty for the ContentAlignment property. |
| DescriptionProperty |
The backing Microsoft.UI.Xaml.DependencyProperty for the Description property. |
| HeaderIconProperty |
The backing Microsoft.UI.Xaml.DependencyProperty for the HeaderIcon property. |
| HeaderProperty |
The backing Microsoft.UI.Xaml.DependencyProperty for the Header property. |
| IsActionIconVisibleProperty |
The backing Microsoft.UI.Xaml.DependencyProperty for the IsActionIconVisible property. |
| IsClickEnabledProperty |
The backing Microsoft.UI.Xaml.DependencyProperty for the IsClickEnabled property. |
Properties
| Name | Description |
|---|---|
| ActionIcon |
Gets or sets the icon that is shown when IsClickEnabled is set to true. |
| ActionIconToolTip |
Gets or sets the tooltip of the ActionIcon. |
| ContentAlignment |
Gets or sets the alignment of the Content |
| Description |
Gets or sets the description. |
| Header |
Gets or sets the Header. |
| HeaderIcon |
Gets or sets the icon on the left. |
| IsActionIconVisible |
Gets or sets if the ActionIcon is shown. |
| IsClickEnabled |
Gets or sets if the card can be clicked. |
Methods
| Name | Description |
|---|---|
| Control_PointerEntered(Object, PointerRoutedEventArgs) |
Handles the PointerEntered event. |
| Control_PointerExited(Object, PointerRoutedEventArgs) |
Handles the PointerExited event. |
| OnApplyTemplate() | Microsoft.UI.Xaml.Controls.Primitives.ButtonBase.OnApplyTemplate |
| OnCreateAutomationPeer() |
Creates AutomationPeer |
| OnDescriptionPropertyChanged(Object, Object) |
Called when the Description property changes. |
| OnHeaderIconPropertyChanged(IconElement, IconElement) |
Called when the HeaderIcon property changes. |
| OnHeaderPropertyChanged(Object, Object) |
Called when the Header property changes. |
| OnIsActionIconVisiblePropertyChanged(Boolean, Boolean) |
Called when the IsActionIconVisible property changes. |
| OnIsClickEnabledPropertyChanged(Boolean, Boolean) |
Called when the IsClickEnabled property changes. |
| OnPointerPressed(PointerRoutedEventArgs) |
Handles the PointerPressed event. |
| OnPointerReleased(PointerRoutedEventArgs) |
Handles the PointerReleased event. |