In This Article

AnimatedExpander Class

Represents an expander with an optional animated expansion.

public class AnimatedExpander : Expander
Inheritance:
object Visual UIElement FrameworkElement Control ContentControl HeaderedContentControl Expander object

Constructors

AnimatedExpander()

Initializes an instance of the class.

public AnimatedExpander()

Properties

CanMeasureCollapsedContent

Indicates whether the expander will use the width measurement of collapsed content when calculating its own width.

public bool CanMeasureCollapsedContent { get; set; }

Property Value

bool:

true if the expander will use the width measurement of collapsed content when calculating its own width; otherwise, false. The default value is true.

Remarks

When true, a consistent width will be maintained when collapsed. When false, the expander will load faster (if collapsed) since less measuring is taking place.

CollapseDuration

The Duration of the collapse animation.

public Duration CollapseDuration { get; set; }

Property Value

Duration:

The default value is 250 milliseconds.

ExpandDuration

The Duration of the expand animation.

public Duration ExpandDuration { get; set; }

Property Value

Duration:

The default value is 250 milliseconds.

HeaderContextMenu

The ContextMenu used for the header.

public ContextMenu? HeaderContextMenu { get; set; }

Property Value

ContextMenu:

The default value is null.

HeaderCornerRadius

The corner radius used by the header.

public CornerRadius HeaderCornerRadius { get; set; }

Property Value

CornerRadius:

The default value is 0,0,0,0.

HeaderPadding

The Thickness of the padding around header content.

public Thickness HeaderPadding { get; set; }

Property Value

Thickness:

The default value is 0,0,0,0

IsAutoCollapseOnBlurEnabled

Indicates whether the expander will auto-collapse when focus leaves it.

public bool IsAutoCollapseOnBlurEnabled { get; set; }

Property Value

bool:

true if the expander will auto-collapse when focus leaves it; otherwise, false. The default value is false.

IsAutoExpandOnFocusEnabled

Indicates whether the expander will auto-expand when focus enters it.

public bool IsAutoExpandOnFocusEnabled { get; set; }

Property Value

bool:

true if the expander will auto-expand when focus enters it; otherwise, false. The default value is false.

IsAutoFocusOnExpandEnabled

Indicates whether focus will attempt to be set in the content of the expander following the completion of the expansion animation.

public bool IsAutoFocusOnExpandEnabled { get; set; }

Property Value

bool:

true if focus will be set; otherwise, false. The default value is false.

Methods

OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs)

Invoked just before the IsKeyboardFocusWithinChanged event is raised by this element. Implement this method to add class handling for this event.

protected override void OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs e)
Parameter Type Description
e DependencyPropertyChangedEventArgs

A System.Windows.DependencyPropertyChangedEventArgs that contains the event data.

Fields

CanMeasureCollapsedContentProperty

Defines the CanMeasureCollapsedContent property.

public static readonly DependencyProperty CanMeasureCollapsedContentProperty

CollapseDurationProperty

Defines the CollapseDuration property.

public static readonly DependencyProperty CollapseDurationProperty

ExpandDurationProperty

Defines the ExpandDuration property.

public static readonly DependencyProperty ExpandDurationProperty

HeaderContextMenuProperty

Defines the HeaderContextMenu property.

public static readonly DependencyProperty HeaderContextMenuProperty

HeaderCornerRadiusProperty

Defines the HeaderCornerRadius property.

public static readonly DependencyProperty HeaderCornerRadiusProperty

HeaderPaddingProperty

Defines the HeaderPadding property.

public static readonly DependencyProperty HeaderPaddingProperty

IsAutoCollapseOnBlurEnabledProperty

Defines the IsAutoCollapseOnBlurEnabled property.

public static readonly DependencyProperty IsAutoCollapseOnBlurEnabledProperty

IsAutoExpandOnFocusEnabledProperty

Defines the IsAutoExpandOnFocusEnabled property.

public static readonly DependencyProperty IsAutoExpandOnFocusEnabledProperty

IsAutoFocusOnExpandEnabledProperty

Defines the IsAutoFocusOnExpandEnabled property.

public static readonly DependencyProperty IsAutoFocusOnExpandEnabledProperty

Extension Methods