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_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 a new instance of the class.
public SettingsExpander()
Properties
Content
The setting content.
ContentTemplate
The template used to display the Content.
ContentTemplateSelector
Gets or sets the DataTemplateSelector to use for Content.
public DataTemplateSelector ContentTemplateSelector { get; set; }
Property Value
- DataTemplateSelector:
The DataTemplateSelector to use for Content.
CornerRadius
The corner radius of the element.
Description
The setting description.
DescriptionTemplate
The template used to display the Description.
DescriptionTemplateSelector
Gets or sets the DataTemplateSelector to use for Description.
public DataTemplateSelector DescriptionTemplateSelector { get; set; }
Property Value
- DataTemplateSelector:
The DataTemplateSelector to use for Description.
HasContent
Gets a value indicating 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
Gets or sets the DataTemplateSelector to use for HeaderIcon.
public DataTemplateSelector HeaderIconTemplateSelector { get; set; }
Property Value
- DataTemplateSelector:
The DataTemplateSelector to use for HeaderIcon.
HeaderTemplate
The template used to display the Header.
HeaderTemplateSelector
Gets or sets the DataTemplateSelector to use for Header.
public DataTemplateSelector HeaderTemplateSelector { get; set; }
Property Value
- DataTemplateSelector:
The DataTemplateSelector to use for Header.
IsAnimationEnabled
Whether animation is enabled.
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, ornull
to show the description only when description content is available. The default value isnull
.
IsExpanded
Indictes whether the expander is open and visible.
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, ornull
to 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?:
true
to force the header to be visible,false
to force the header to be hidden, ornull
to 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?:
true
to force the items footer to be visible,false
to force the items footer to be hidden, ornull
to 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?:
true
to force the items header to be visible,false
to force the items header to be hidden, ornull
to 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?:
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 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 card will be wrapped.
public double WrapThreshold { get; set; }
Property Value
Remarks
The card 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:
true
if 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
ContentProperty
Identifies the Content dependency property.
public static readonly DependencyProperty ContentProperty
ContentTemplateProperty
Identifies the ContentTemplate depedency property.
public static readonly DependencyProperty ContentTemplateProperty
ContentTemplateSelectorProperty
Identifies the ContentTemplateSelector dependency property.
public static readonly DependencyProperty ContentTemplateSelectorProperty
CornerRadiusProperty
Identifies the CornerRadius dependency property.
public static readonly DependencyProperty CornerRadiusProperty
DescriptionProperty
Identifies the Description depedency property.
public static readonly DependencyProperty DescriptionProperty
DescriptionTemplateProperty
Identifies the DescriptionTemplate depedency property.
public static readonly DependencyProperty DescriptionTemplateProperty
DescriptionTemplateSelectorProperty
Identifies the DescriptionTemplateSelector dependency property.
public static readonly DependencyProperty DescriptionTemplateSelectorProperty
HasContentProperty
Identifies the read-only HasContent dependency property.
public static readonly DependencyProperty HasContentProperty
HeaderIconProperty
Identifies the HeaderIcon dependency property.
public static readonly DependencyProperty HeaderIconProperty
HeaderIconTemplateProperty
Identifies the HeaderIconTemplate depedency property.
public static readonly DependencyProperty HeaderIconTemplateProperty
HeaderIconTemplateSelectorProperty
Identifies the HeaderIconTemplateSelector dependency property.
public static readonly DependencyProperty HeaderIconTemplateSelectorProperty
HeaderProperty
Identifies the Header dependency property.
public static readonly DependencyProperty HeaderProperty
HeaderTemplateProperty
Identifies the HeaderTemplate depedency 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
IsDescriptionVisibleProperty
Identifies the IsDescriptionVisible depedency property.
public static readonly DependencyProperty IsDescriptionVisibleProperty
IsExpandedProperty
Identifies the IsExpanded depedency property.
public static readonly DependencyProperty IsExpandedProperty
IsHeaderIconVisibleProperty
Identifies the IsHeaderIconVisible depedency property.
public static readonly DependencyProperty IsHeaderIconVisibleProperty
IsHeaderVisibleProperty
Identifies the IsHeaderVisible depedency property.
public static readonly DependencyProperty IsHeaderVisibleProperty
IsItemsFooterVisibleProperty
Identifies the IsItemsFooterVisible depedency property.
public static readonly DependencyProperty IsItemsFooterVisibleProperty
IsItemsHeaderVisibleProperty
Identifies the IsItemsHeaderVisible depedency property.
public static readonly DependencyProperty IsItemsHeaderVisibleProperty
IsWrappedProperty
Identifies the IsWrapped depedency property.
public static readonly DependencyProperty IsWrappedProperty
ItemsFooterProperty
Identifies the ItemsFooter dependency property.
public static readonly DependencyProperty ItemsFooterProperty
ItemsFooterTemplateProperty
Identifies the ItemsFooterTemplate depedency property.
public static readonly DependencyProperty ItemsFooterTemplateProperty
ItemsFooterTemplateSelectorProperty
Identifies the ItemsFooterTemplateSelector dependency property.
public static readonly DependencyProperty ItemsFooterTemplateSelectorProperty
ItemsHeaderProperty
Identifies the ItemsHeader dependency property.
public static readonly DependencyProperty ItemsHeaderProperty
ItemsHeaderTemplateProperty
Identifies the ItemsHeaderTemplate depedency property.
public static readonly DependencyProperty ItemsHeaderTemplateProperty
ItemsHeaderTemplateSelectorProperty
Identifies the ItemsHeaderTemplateSelector dependency property.
public static readonly DependencyProperty ItemsHeaderTemplateSelectorProperty
WrapThresholdProperty
Identifies the WrapThreshold depedency property.
public static readonly DependencyProperty WrapThresholdProperty