Läs på engelska Redigera

Dela via


Expander.Collapsed Event

Definition

Occurs when the content window of an Expander control closes and only the Header is visible.

C#
public event System.Windows.RoutedEventHandler Collapsed;

Event Type

Examples

The following example shows how to specify the event handler for the Collapsed event.

C#
myExpander.Collapsed += new RoutedEventHandler(expanderHasCollapsed);
XAML
<Expander Name ="myExpander" Collapsed="expanderHasCollapsed" 
          Header ="expanderTitle" Content="expanderContent"/>

The following example shows how to define the event handler.

C#
private void expanderHasCollapsed(object sender, RoutedEventArgs args)
{
    //Do something when the Expander control collapses
}

Remarks

The Collapsed event occurs when the IsExpanded property changes from true to false.

Routed Event Information

Item Value
Identifier field CollapsedEvent
Routing strategy Bubbling
Delegate RoutedEventHandler

Applies to

Produkt Versioner
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

See also