SettingsExpander Class
Displays a setting within a card that can be expanded to show additional settings.
[TemplatePart(Name = "PART_ContentPresenter", Type = typeof(ContentPresenter))]
[TemplatePart(Name = "PART_DescriptionPresenter", Type = typeof(ContentPresenter))]
[TemplatePart(Name = "PART_ExpanderIconPresenter", Type = typeof(ContentPresenter))]
[TemplatePart(Name = "PART_HeaderPresenter", Type = typeof(ContentPresenter))]
[TemplatePart(Name = "PART_HeaderIconPresenter", Type = typeof(ContentPresenter))]
[TemplatePart(Name = "PART_ItemsFooterPresenter", Type = typeof(ContentPresenter))]
[TemplatePart(Name = "PART_ItemsHeaderPresenter", Type = typeof(ContentPresenter))]
[TemplatePart(Name = "PART_ItemsPresenter", Type = typeof(ItemsPresenter))]
public class SettingsExpander : ItemsControl
- Inheritance:
- object Visual UIElement FrameworkElement Control ItemsControl object
Constructors
SettingsExpander()
Initializes an instance of the class.
public SettingsExpander()
Properties
CanToggleExpansion
Indicates if the user is allowed to toggle the expansion state.
public bool CanToggleExpansion { get; set; }
Property Value
- bool:
trueif the user can toggle the expansion state; otherwise,falseif the user cannot toggle the expansion state. The default value istrue.
Content
The setting content.
ContentTemplate
The template used to display the Content.
ContentTemplateSelector
The DataTemplateSelector to use for Content.
public DataTemplateSelector? ContentTemplateSelector { get; set; }
Property Value
CornerRadius
The corner radius of the element.
Description
The setting description.
DescriptionTemplate
The template used to display the Description.
DescriptionTemplateSelector
The DataTemplateSelector to use for Description.
public DataTemplateSelector? DescriptionTemplateSelector { get; set; }
Property Value
ExpanderIcon
The content for the Expander icon.
ExpanderIconTemplate
The template used to display the ExpanderIcon.
ExpanderIconTemplateSelector
The DataTemplateSelector to use for ExpanderIcon.
public DataTemplateSelector? ExpanderIconTemplateSelector { get; set; }
Property Value
HasContent
Indicates whether Content has a non-null value.
public bool HasContent { get; }
Property Value
Header
The content for the header.
HeaderIcon
The content for the header icon.
HeaderIconTemplate
The template used to display the HeaderIcon.
HeaderIconTemplateSelector
The DataTemplateSelector to use for HeaderIcon.
public DataTemplateSelector? HeaderIconTemplateSelector { get; set; }
Property Value
HeaderTemplate
The template used to display the Header.
HeaderTemplateSelector
The DataTemplateSelector to use for Header.
public DataTemplateSelector? HeaderTemplateSelector { get; set; }
Property Value
IsAnimationEnabled
Whether animation is enabled.
IsDescriptionVisible
Indicates if the description is visible.
public bool? IsDescriptionVisible { get; set; }
Property Value
- bool?:
trueto force the description to be visible,falseto force the description to be hidden, ornullto show the description only when description content is available. The default value isnull.
IsExpanded
Indicates whether the expander is open and visible.
IsExpanderIconVisible
Indicates if the expander icon is visible.
public bool? IsExpanderIconVisible { get; set; }
Property Value
- bool?:
trueto force the icon to be visible,falseto force the icon to be hidden, ornullto show the icon only when icon content is available. The default value isnull.
IsHeaderIconVisible
Indicates if the header icon is visible.
public bool? IsHeaderIconVisible { get; set; }
Property Value
- bool?:
trueto force the icon to be visible,falseto force the icon to be hidden, ornullto show the icon only when icon 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.
IsItemsFooterVisible
Indicates if the items footer is visible.
public bool? IsItemsFooterVisible { get; set; }
Property Value
- bool?:
trueto force the items footer to be visible,falseto force the items footer to be hidden, ornullto show the items footer only when items footer content is available. The default value isnull.
IsItemsHeaderVisible
Indicates if the items header is visible.
public bool? IsItemsHeaderVisible { get; set; }
Property Value
- bool?:
trueto force the items header to be visible,falseto force the items header to be hidden, ornullto show the items header only when items header content is available. The default value isnull.
IsWrapped
Indicates if the content is wrapped.
public bool? IsWrapped { get; set; }
Property Value
- bool?:
trueto force the content to be wrapped,falseto prevent the content from being wrapped,nullto wrap the content only when the card's width is below a certain threshold. The default value isnull.
ItemsFooter
The content displayed below the items.
ItemsFooterTemplate
The template used to display the ItemsFooter.
ItemsFooterTemplateSelector
Gets or sets the DataTemplateSelector to use for ItemsFooter.
public DataTemplateSelector? ItemsFooterTemplateSelector { get; set; }
Property Value
- DataTemplateSelector:
The DataTemplateSelector to use for ItemsFooter.
ItemsHeader
The content displayed above the items.
ItemsHeaderTemplate
The template used to display the ItemsHeader.
ItemsHeaderTemplateSelector
Gets or sets the DataTemplateSelector to use for ItemsHeader.
public DataTemplateSelector? ItemsHeaderTemplateSelector { get; set; }
Property Value
- DataTemplateSelector:
The DataTemplateSelector to use for ItemsHeader.
WrapThreshold
The width threshold at which the expander will be wrapped.
public double WrapThreshold { get; set; }
Property Value
Remarks
The expander will be wrapped when the width is less than or equal to the configured threshold.
Methods
ClearContainerForItemOverride(DependencyObject, object)
When overridden in a derived class, undoes the effects of the PrepareContainerForItemOverride(DependencyObject, object) method.
protected override void ClearContainerForItemOverride(DependencyObject element, object item)
| Parameter | Type | Description |
|---|---|---|
| element | DependencyObject | The container element. |
| item | object | The item. |
GetContainerForItemOverride()
Creates or identifies the element that is used to display the given item.
protected override DependencyObject GetContainerForItemOverride()
Returns
- DependencyObject:
The element that is used to display the given item.
IsItemItsOwnContainerOverride(object)
Determines if the specified item is (or is eligible to be) its own container.
protected override bool IsItemItsOwnContainerOverride(object item)
| Parameter | Type | Description |
|---|---|---|
| item | object | The item to check. |
Returns
- bool:
trueif the item is (or is eligible to be) its own container; otherwise,false.
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().
public override void OnApplyTemplate()
OnCreateAutomationPeer()
Returns class-specific AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.
protected override AutomationPeer OnCreateAutomationPeer()
Returns
- AutomationPeer:
The type-specific AutomationPeer implementation.
OnRenderSizeChanged(SizeChangedInfo)
Raises the SizeChanged event, using the specified information as part of the eventual event data.
protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
| Parameter | Type | Description |
|---|---|---|
| sizeInfo | SizeChangedInfo | Details of the old and new size involved in the change. |
PrepareContainerForItemOverride(DependencyObject, object)
Prepares the specified element to display the specified item.
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
| Parameter | Type | Description |
|---|---|---|
| element | DependencyObject | Element used to display the specified item. |
| item | object | Specified item. |
ToString()
Returns the string representation of this object.
Fields
CanToggleExpansionProperty
Defines the CanToggleExpansion property.
public static readonly DependencyProperty CanToggleExpansionProperty
ContentProperty
Defines the Content property.
public static readonly DependencyProperty ContentProperty
ContentTemplateProperty
Defines the ContentTemplate property.
public static readonly DependencyProperty ContentTemplateProperty
ContentTemplateSelectorProperty
Defines the ContentTemplateSelector property.
public static readonly DependencyProperty ContentTemplateSelectorProperty
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
ExpanderIconProperty
Defines the ExpanderIcon property.
public static readonly DependencyProperty ExpanderIconProperty
ExpanderIconTemplateProperty
Defines the ExpanderIconTemplate property.
public static readonly DependencyProperty ExpanderIconTemplateProperty
ExpanderIconTemplateSelectorProperty
Defines the ExpanderIconTemplateSelector property.
public static readonly DependencyProperty ExpanderIconTemplateSelectorProperty
HasContentProperty
Defines the HasContent property.
public static readonly DependencyProperty HasContentProperty
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
IsAnimationEnabledProperty
Defines the IsAnimationEnabled property.
public static readonly DependencyProperty IsAnimationEnabledProperty
IsDescriptionVisibleProperty
Defines the IsDescriptionVisible property.
public static readonly DependencyProperty IsDescriptionVisibleProperty
IsExpandedProperty
Defines the IsExpanded property.
public static readonly DependencyProperty IsExpandedProperty
IsExpanderIconVisibleProperty
Defines the IsExpanderIconVisible property.
public static readonly DependencyProperty IsExpanderIconVisibleProperty
IsHeaderIconVisibleProperty
Defines the IsHeaderIconVisible property.
public static readonly DependencyProperty IsHeaderIconVisibleProperty
IsHeaderVisibleProperty
Defines the IsHeaderVisible property.
public static readonly DependencyProperty IsHeaderVisibleProperty
IsItemsFooterVisibleProperty
Defines the IsItemsFooterVisible property.
public static readonly DependencyProperty IsItemsFooterVisibleProperty
IsItemsHeaderVisibleProperty
Defines the IsItemsHeaderVisible property.
public static readonly DependencyProperty IsItemsHeaderVisibleProperty
IsWrappedProperty
Defines the IsWrapped property.
public static readonly DependencyProperty IsWrappedProperty
ItemsFooterProperty
Defines the ItemsFooter property.
public static readonly DependencyProperty ItemsFooterProperty
ItemsFooterTemplateProperty
Defines the ItemsFooterTemplate property.
public static readonly DependencyProperty ItemsFooterTemplateProperty
ItemsFooterTemplateSelectorProperty
Defines the ItemsFooterTemplateSelector property.
public static readonly DependencyProperty ItemsFooterTemplateSelectorProperty
ItemsHeaderProperty
Defines the ItemsHeader property.
public static readonly DependencyProperty ItemsHeaderProperty
ItemsHeaderTemplateProperty
Defines the ItemsHeaderTemplate property.
public static readonly DependencyProperty ItemsHeaderTemplateProperty
ItemsHeaderTemplateSelectorProperty
Defines the ItemsHeaderTemplateSelector property.
public static readonly DependencyProperty ItemsHeaderTemplateSelectorProperty
WrapThresholdProperty
Defines the WrapThreshold property.
public static readonly DependencyProperty WrapThresholdProperty