Class Expander
Represents a control that displays a header and has a collapsible content window.
Inheritance
Inherited Members
Namespace: System.Windows.Controls
Assembly: OpenSilver.dll
Syntax
[TemplatePart(Name = "ExpanderButton", Type = typeof(ToggleButton))]
public class Expander : HeaderedContentControl
Constructors
| Improve this Doc View SourceExpander()
Initializes a new instance of the Expander class.
Declaration
public Expander()
Fields
| Improve this Doc View SourceExpandDirectionProperty
Identifies the ExpandDirection dependency property.
Declaration
public static readonly DependencyProperty ExpandDirectionProperty
Field Value
Type | Description |
---|---|
DependencyProperty | The identifier for the ExpandDirection dependency property. |
IsExpandedProperty
Identifies the IsExpanded dependency property.
Declaration
public static readonly DependencyProperty IsExpandedProperty
Field Value
Type | Description |
---|---|
DependencyProperty | The identifier for the IsExpanded dependency property. |
Properties
| Improve this Doc View SourceExpandDirection
Gets or sets the direction in which the Expander content window opens.
Declaration
public ExpandDirection ExpandDirection { get; set; }
Property Value
Type | Description |
---|---|
ExpandDirection | One of the ExpandDirection values that define which direction the content window opens. The default is Down. |
IsExpanded
Gets or sets a value indicating whether the Expander content window is visible.
Declaration
public bool IsExpanded { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if the content window is expanded; otherwise, false. The default is false. |
Methods
| Improve this Doc View SourceOnApplyTemplate()
Builds the visual tree for the Expander control when a new template is applied.
Declaration
public override void OnApplyTemplate()
Overrides
| Improve this Doc View SourceOnCollapsed()
Raises the Collapsed event when the IsExpanded property changes from true to false.
Declaration
protected virtual void OnCollapsed()
OnCreateAutomationPeer()
Returns a ExpanderAutomationPeer for use by the Silverlight automation infrastructure.
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
Type | Description |
---|---|
AutomationPeer | A ExpanderAutomationPeer object for the Expander. |
Overrides
| Improve this Doc View SourceOnExpanded()
Raises the Expanded event when the IsExpanded property changes from false to true.
Declaration
protected virtual void OnExpanded()
OnKeyDown(KeyEventArgs)
Provides handling for the KeyDown event.
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
KeyEventArgs | e | Key event args. |
Overrides
Events
| Improve this Doc View SourceCollapsed
Declaration
public event RoutedEventHandler Collapsed
Event Type
Type | Description |
---|---|
RoutedEventHandler |
Expanded
Occurs when the content window of an Expander control opens to display both its header and content.
Declaration
public event RoutedEventHandler Expanded
Event Type
Type | Description |
---|---|
RoutedEventHandler |