Expander Class

Definition

The Expander control allows user to show/hide content based on a boolean state

[Windows.UI.Xaml.Markup.ContentProperty(Name="Content")]
[Windows.UI.Xaml.TemplatePart(Name="PART_RootGrid", Type=typeof(Windows.UI.Xaml.Controls.Grid))]
[Windows.UI.Xaml.TemplatePart(Name="PART_ExpanderToggleButton", Type=typeof(Windows.UI.Xaml.Controls.Primitives.ToggleButton))]
[Windows.UI.Xaml.TemplatePart(Name="PART_LayoutTransformer", Type=typeof(Microsoft.Toolkit.Uwp.UI.Controls.LayoutTransformControl))]
[Windows.UI.Xaml.TemplateVisualState(GroupName="ExpandDirectionStates", Name="LeftDirection")]
[Windows.UI.Xaml.TemplateVisualState(GroupName="ExpandDirectionStates", Name="DownDirection")]
[Windows.UI.Xaml.TemplateVisualState(GroupName="ExpandDirectionStates", Name="RightDirection")]
[Windows.UI.Xaml.TemplateVisualState(GroupName="ExpandDirectionStates", Name="UpDirection")]
[Windows.UI.Xaml.TemplateVisualState(GroupName="DisplayModeAndDirectionStates", Name="VisibleLeft")]
[Windows.UI.Xaml.TemplateVisualState(GroupName="DisplayModeAndDirectionStates", Name="VisibleDown")]
[Windows.UI.Xaml.TemplateVisualState(GroupName="DisplayModeAndDirectionStates", Name="VisibleRight")]
[Windows.UI.Xaml.TemplateVisualState(GroupName="DisplayModeAndDirectionStates", Name="VisibleUp")]
[Windows.UI.Xaml.TemplateVisualState(GroupName="DisplayModeAndDirectionStates", Name="CollapsedLeft")]
[Windows.UI.Xaml.TemplateVisualState(GroupName="DisplayModeAndDirectionStates", Name="CollapsedDown")]
[Windows.UI.Xaml.TemplateVisualState(GroupName="DisplayModeAndDirectionStates", Name="CollapsedRight")]
[Windows.UI.Xaml.TemplateVisualState(GroupName="DisplayModeAndDirectionStates", Name="CollapsedUp")]
public class Expander : Microsoft.Toolkit.Uwp.UI.Controls.HeaderedContentControl
[<Windows.UI.Xaml.Markup.ContentProperty(Name="Content")>]
[<Windows.UI.Xaml.TemplatePart(Name="PART_RootGrid", Type=typeof(Windows.UI.Xaml.Controls.Grid))>]
[<Windows.UI.Xaml.TemplatePart(Name="PART_ExpanderToggleButton", Type=typeof(Windows.UI.Xaml.Controls.Primitives.ToggleButton))>]
[<Windows.UI.Xaml.TemplatePart(Name="PART_LayoutTransformer", Type=typeof(Microsoft.Toolkit.Uwp.UI.Controls.LayoutTransformControl))>]
[<Windows.UI.Xaml.TemplateVisualState(GroupName="ExpandDirectionStates", Name="LeftDirection")>]
[<Windows.UI.Xaml.TemplateVisualState(GroupName="ExpandDirectionStates", Name="DownDirection")>]
[<Windows.UI.Xaml.TemplateVisualState(GroupName="ExpandDirectionStates", Name="RightDirection")>]
[<Windows.UI.Xaml.TemplateVisualState(GroupName="ExpandDirectionStates", Name="UpDirection")>]
[<Windows.UI.Xaml.TemplateVisualState(GroupName="DisplayModeAndDirectionStates", Name="VisibleLeft")>]
[<Windows.UI.Xaml.TemplateVisualState(GroupName="DisplayModeAndDirectionStates", Name="VisibleDown")>]
[<Windows.UI.Xaml.TemplateVisualState(GroupName="DisplayModeAndDirectionStates", Name="VisibleRight")>]
[<Windows.UI.Xaml.TemplateVisualState(GroupName="DisplayModeAndDirectionStates", Name="VisibleUp")>]
[<Windows.UI.Xaml.TemplateVisualState(GroupName="DisplayModeAndDirectionStates", Name="CollapsedLeft")>]
[<Windows.UI.Xaml.TemplateVisualState(GroupName="DisplayModeAndDirectionStates", Name="CollapsedDown")>]
[<Windows.UI.Xaml.TemplateVisualState(GroupName="DisplayModeAndDirectionStates", Name="CollapsedRight")>]
[<Windows.UI.Xaml.TemplateVisualState(GroupName="DisplayModeAndDirectionStates", Name="CollapsedUp")>]
type Expander = class
    inherit HeaderedContentControl
Public Class Expander
Inherits HeaderedContentControl
Inheritance
Windows.UI.Xaml.Controls.ContentControl
Expander
Derived
Attributes
Windows.UI.Xaml.Markup.ContentPropertyAttribute Windows.UI.Xaml.TemplatePartAttribute Windows.UI.Xaml.TemplateVisualStateAttribute

Constructors

Expander()

Initializes a new instance of the Expander class.

Fields

ContentOverlayProperty

Identifies the ContentOverlay dependency property.

ExpandDirectionProperty

Identifies the ExpandDirection dependency property.

HeaderStyleProperty

Identifies the HeaderStyle dependency property.

IsExpandedProperty

Identifies the IsExpanded dependency property.

Properties

ContentOverlay

Gets or sets a value indicating whether the ContentOverlay of the control.

ExpandDirection

Gets or sets a value indicating whether the Expand Direction of the control.

Header

Gets or sets the data used for the header of each control.

(Inherited from HeaderedContentControl)
HeaderStyle

Gets or sets a value for the style to use for the Header of the Expander.

HeaderTemplate

Gets or sets the template used to display the content of the control's header.

(Inherited from HeaderedContentControl)
IsExpanded

Gets or sets a value indicating whether the content of the control is opened/visible or closed/hidden.

Orientation

Gets or sets the Orientation used for the header.

(Inherited from HeaderedContentControl)

Methods

OnApplyTemplate() Windows.UI.Xaml.Controls.ContentControl.OnApplyTemplate
OnCollapsed(EventArgs)

Called when control is collapsed

OnCreateAutomationPeer()

Creates AutomationPeer (Windows.UI.Xaml.UIElement.OnCreateAutomationPeer)

OnExpanded(EventArgs)

Called when control is expanded

OnHeaderChanged(Object, Object)

Called when the Header property changes.

(Inherited from HeaderedContentControl)

Events

Collapsed

Fires when the expander is closed

Expanded

Fires when the expander is opened

Applies to